From patchwork Mon Feb 29 14:44:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 63217 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1291829lbc; Mon, 29 Feb 2016 06:47:52 -0800 (PST) X-Received: by 10.98.79.156 with SMTP id f28mr22577699pfj.55.1456757272578; Mon, 29 Feb 2016 06:47:52 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id vy4si20427591pab.124.2016.02.29.06.47.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Feb 2016 06:47:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for 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: best guess record for 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 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 1aaP69-0004Ed-52; Mon, 29 Feb 2016 14:46:57 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aaP57-0003P9-CO for linux-arm-kernel@lists.infradead.org; Mon, 29 Feb 2016 14:45:54 +0000 Received: by mail-wm0-x233.google.com with SMTP id l68so65908656wml.0 for ; Mon, 29 Feb 2016 06:45:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=11C5XuUqJNI4EA+c5L3HMeX8FuuGb0qhMPV1dHm4ttQ=; b=VpiIJS/jDV4a58bVyq9wSkNrRe1KZ9uJB/GLlS1X+8pzBpBr1e5gxBTyrWprZdkypx pi6MGsQLGLVB9Dl5B4KD1Yr0Y1ZSrJmwtGscxAHOJpUhAojVXz9W1IagTDhEyFyQgui7 p2E/LvuEqGr434Ua+PA9jue7liO5Kd7AcowI4= 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=11C5XuUqJNI4EA+c5L3HMeX8FuuGb0qhMPV1dHm4ttQ=; b=WVnlDc4TF9h/pyaui5BvfEdREGkoXRCtnG/YF8OwS3WwabqonQNif0E+tnyo5LhZS1 p7bIQwDkWm+n3T4Hc73SCh62fnQ42DFmXjNx8aPbPf1KIVPBjkpG63VRRptotpywkpgD hGCw85rmo1uVXEDjkZcyfsjYNh83jbvltx7omTgS6t09rRNud5g3q2vQY7AW993xGBvV Tk7vEc1z7mW0oJSutVPQi/5oL1L0bg9Pm6wtumbgGdE7JmT2Qhy1JRiIc0aJtZBtBMWt NErvNaIrGu28Z1Ce+72nEaL8UoNaLwu9XnF77ZOQeLdmfn+wgGUVUQ8u/yOFijQhjCpB /CbQ== X-Gm-Message-State: AD7BkJLyAEJh0CYldpx1860hTDuvDugYKCqL/vCxsdeUPgEBaVYmwuNgwDOQ/B8nt3Zr6Wzu X-Received: by 10.194.184.234 with SMTP id ex10mr14584646wjc.8.1456757131239; Mon, 29 Feb 2016 06:45:31 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id di1sm26196693wjc.3.2016.02.29.06.45.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Feb 2016 06:45:30 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com Subject: [PATCH v2 3/9] arm64: mm: avoid virt_to_page() translation for the zero page Date: Mon, 29 Feb 2016 15:44:38 +0100 Message-Id: <1456757084-1078-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456757084-1078-1-git-send-email-ard.biesheuvel@linaro.org> References: <1456757084-1078-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160229_064553_724847_DE075801 X-CRM114-Status: GOOD ( 10.51 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:233 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_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: jonas@southpole.se, Ard Biesheuvel , linux-mm@kvack.org, nios2-dev@lists.rocketboards.org, linux@lists.openrisc.net, lftan@altera.com, akpm@linux-foundation.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The zero page is statically allocated, so grab its struct page pointer without using virt_to_page(), which will be restricted to the linear mapping later. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.5.0 _______________________________________________ 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/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 7d0a9eab1133..af80e437d075 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -57,7 +57,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val); * for zero-mapped memory areas etc.. */ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]; -#define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page) +#define ZERO_PAGE(vaddr) pfn_to_page(__pa(empty_zero_page) >> PAGE_SHIFT) #define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte_val(pte))