From patchwork Mon Feb 22 20:54:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 62632 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1471625lbl; Mon, 22 Feb 2016 12:58:34 -0800 (PST) X-Received: by 10.98.68.194 with SMTP id m63mr40888548pfi.153.1456174714813; Mon, 22 Feb 2016 12:58:34 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id r71si41924077pfa.179.2016.02.22.12.58.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Feb 2016 12:58:34 -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 1aXxWr-0005E9-Dc; Mon, 22 Feb 2016 20:56:25 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aXxVo-0003I6-K3 for linux-arm-kernel@lists.infradead.org; Mon, 22 Feb 2016 20:55:25 +0000 Received: by mail-wm0-x22b.google.com with SMTP id g62so182010613wme.0 for ; Mon, 22 Feb 2016 12:55:00 -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=f7WHDcnPzb910uOVblW2mWcMu3vrzG3DJjz2LWuV76Y=; b=KkXU8NOjV9KXLP1K045j7A2OYhu029PDT/T2fZuSgXqKG0xs3NAwnhV3Y3mHmeDhwZ YMh6ExslIJRdMoGIaWjmqsGtMzuCykug7ICVjo8QW82kiGXYWJX0R2ruhUJcG75LcQGh VgnD4EYuqSAkxLnwsmm8hrfJ91O250pBbr5u0= 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=f7WHDcnPzb910uOVblW2mWcMu3vrzG3DJjz2LWuV76Y=; b=at5g5srgfqyMM9SKLOw/1QFv2j+fZuuxB1DRvxX2QAuaKKLcfewOgYY+PzEdSHo4xk RkkbsZ7prhwjr1nFgnS7Y2bzj7Zs4JqjTFhKO9CPusJGPNbJ077zlTh5+mG7sBLoO09Q eu3qaQdboJODFySr//Zz/Z7GKXNqd26oWQdwaGLb5TdEwlapQi7gtw2TlLaNY6UO/12A 7h27OKZl+N++2nJ9A9r9aAE9XOKP6q4g0idLoS/YMrhVDeI/hUJL8r3qV5Df1KP0v2/9 BfGjdps7Wp4bVtJJUhNe1SgJIbFDuSpT+/5B/vcn8qoAxbM1/b1KyOn7q21E3LBmafMC XKvw== X-Gm-Message-State: AG10YORsEwuFB7ZVYkZA+g68OU6YK324K4BXO/kvxYK5sfFH8c2S5PK9E2TKGkHvZVEO5y5R X-Received: by 10.194.95.40 with SMTP id dh8mr33828988wjb.146.1456174498971; Mon, 22 Feb 2016 12:54:58 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id k8sm15012530wjr.38.2016.02.22.12.54.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Feb 2016 12:54:58 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, will.deacon@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com Subject: [RFC PATCH 04/10] arm64: mm: avoid __pa translations on empty_zero_page Date: Mon, 22 Feb 2016 21:54:26 +0100 Message-Id: <1456174472-30028-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456174472-30028-1-git-send-email-ard.biesheuvel@linaro.org> References: <1456174472-30028-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160222_125521_066401_1705F95A X-CRM114-Status: GOOD ( 12.76 ) 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:22b 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_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The variable empty_zero_page is part of the static kernel text, so we should use __pa_symbol() not __pa() to take its physical address. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/mmu_context.h | 2 +- arch/arm64/include/asm/pgtable.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 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/mmu_context.h b/arch/arm64/include/asm/mmu_context.h index 40fc56f3ed52..b03272fc501e 100644 --- a/arch/arm64/include/asm/mmu_context.h +++ b/arch/arm64/include/asm/mmu_context.h @@ -49,7 +49,7 @@ static inline void contextidr_thread_switch(struct task_struct *next) */ static inline void cpu_set_reserved_ttbr0(void) { - unsigned long ttbr = virt_to_phys(empty_zero_page); + unsigned long ttbr = __pa_symbol(empty_zero_page); asm( " msr ttbr0_el1, %0 // set TTBR0\n" diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index a440f5a85d08..528482f53f12 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -117,7 +117,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) phys_to_page(__pa_symbol(empty_zero_page)) #define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte_val(pte))