From patchwork Mon Nov 9 08:55:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 56188 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp63711lbb; Mon, 9 Nov 2015 00:57:44 -0800 (PST) X-Received: by 10.68.194.4 with SMTP id hs4mr38839445pbc.116.1447059464278; Mon, 09 Nov 2015 00:57:44 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id a1si21092945pas.56.2015.11.09.00.57.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Nov 2015 00:57:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZviFd-0007Wr-5O; Mon, 09 Nov 2015 08:56:33 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZviFP-0007SX-OG for linux-arm-kernel@lists.infradead.org; Mon, 09 Nov 2015 08:56:22 +0000 Received: by wmww144 with SMTP id w144so24438346wmw.0 for ; Mon, 09 Nov 2015 00:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=y7dQAKaOyfVlc3z2r9Ik6NYghY+lv7VLS31veiqOMg8=; b=nvt8ExY8QXDxNn+65yFk9ZS1l3BGFyiDJHKVScVXffKybEf/AhJmVepsvCCe9tyiXL Dqu8VACPgQ9QYKC3gqAnHWiUGO2XMqRTNYIfrPQIL+gONGxnGxi1oHJwEr90eEDXIlUn +DVEN3LXsEdYbojm4Ll/sl3uE6OtSJHRb2//I/NXbjKpG2FX3qW7SGVxMxSgC8M8Nn4m x1aSG8nNE496KkGk86hM0Q25gz/MTJGvvRJ/03LTWvmVd/K2jLSXvZSYzQsZsZ6FrIp6 KzqQ48HPV8JsT7RYAuAw8woNARqgImk7UZ6E2F5/+3WGOBgZMgIhqfPxZi2SdXosrCLz uiGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=y7dQAKaOyfVlc3z2r9Ik6NYghY+lv7VLS31veiqOMg8=; b=LvQLpqYMG1ao3eMwStA5JiBFWwu8frwTjyK57J3G8HEXZcyDTgut91guSkHu4Jwcqb LuiOYynpZn0AhzVnrRaraCV/ioRW+h0sXd3xSfVMGPUcTfuZrvXJTOyqazn8fNCW1uHM pssEVBnzqg4bUjGASyxQiZh4gNVPM3/hLFtGMxHLndsb/dIFa6xST7x3nVbgYV2x4Jxq vkyAyskDpe4UeNzR0QmDB62LFGmTUvujBaAWYyAWYiWnOkZ7Iih/sgWb+BQyrP/V6aaK o8qmW5VHEmJxTNj5sne6YhWJ9HUsfaqVzKY9FaWEhU2cFWETbzJPurRgzAhoP6eFvVW0 lFaA== X-Gm-Message-State: ALoCoQlgCvqfUPNeHBsKu7ykNHSC/KW/6MZS1ZwAIReTPg7euU0ZeBKjurnzQ//YfazGc36QL7bx X-Received: by 10.28.145.145 with SMTP id t139mr26710518wmd.0.1447059358137; Mon, 09 Nov 2015 00:55:58 -0800 (PST) Received: from localhost.localdomain ([176.244.176.159]) by smtp.gmail.com with ESMTPSA id t126sm13053106wmd.23.2015.11.09.00.55.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Nov 2015 00:55:57 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com Subject: [PATCH 1/2] arm64: fix STRICT_MM_TYPECHECKS issue in PTE_CONT manipulation Date: Mon, 9 Nov 2015 09:55:45 +0100 Message-Id: <1447059346-12050-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447059346-12050-1-git-send-email-ard.biesheuvel@linaro.org> References: <1447059346-12050-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151109_005619_934524_1F6BC556 X-CRM114-Status: GOOD ( 12.89 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c09:0:0:0:232 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: will.deacon@arm.com, jeremy.linton@arm.com, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The new page table code that manipulates the PTE_CONT flags does so in a way that is inconsistent with STRICT_MM_TYPECHECKS. Fix it by using the correct combination of __pgprot() and pgprot_val(). Signed-off-by: Ard Biesheuvel --- arch/arm64/mm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 4cf54411b392..46a2b8805c97 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -149,7 +149,7 @@ static void alloc_init_pte(pmd_t *pmd, unsigned long addr, if (((addr | next | phys) & ~CONT_MASK) == 0) { /* a block of CONT_PTES */ __populate_init_pte(pte, addr, next, phys, - prot | __pgprot(PTE_CONT)); + __pgprot(pgprot_val(prot) | PTE_CONT)); } else { /* * If the range being split is already inside of a