From patchwork Wed Mar 30 14:45:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 64706 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2639207lbc; Wed, 30 Mar 2016 07:48:15 -0700 (PDT) X-Received: by 10.98.14.147 with SMTP id 19mr13827475pfo.79.1459349295223; Wed, 30 Mar 2016 07:48:15 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ui8si7000815pab.38.2016.03.30.07.48.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Mar 2016 07:48:15 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@linaro.org; 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; dmarc=fail (p=NONE dis=NONE) header.from=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 1alHOy-0000Oj-5r; Wed, 30 Mar 2016 14:47:20 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1alHOI-00083z-0G for linux-arm-kernel@lists.infradead.org; Wed, 30 Mar 2016 14:46:39 +0000 Received: by mail-wm0-x235.google.com with SMTP id r72so102911515wmg.0 for ; Wed, 30 Mar 2016 07:46:17 -0700 (PDT) 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=bXqg2RtFxOBZU5HW5aIxJjnPk4zqLixaCuz8VDybL+w=; b=NktCW0VNmXsOe/Zh4+jmO0vHLD3iTZqf4+KoWacPzXxnhU2Ngj/58F1KogUeKqHAF5 Kk8lO8SXouUg1weAsom5lvbPzMZKp3VPEfXXRWi0uIYqL9AFsDTF/mMdSDgpEMs9YqI+ KnEZ8pM9yeAXvFpzcLsGrb16QNQbhTC/IFYVA= 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=bXqg2RtFxOBZU5HW5aIxJjnPk4zqLixaCuz8VDybL+w=; b=XQEpSlyEs3+iaSEbBGNC7R0kX2PiBuruyJzc3QxW6uVYvIDo3l/MzHkpU5OvXnDKio 42S5m5hdrQxtIAg8vI3A8BMY+m64If8wrMHreqdjv6qF5srKNJrE/lm3bZVgFymyoCRl 2eqSbYpnJUsuBVPKDV5qqVwzuJzoMGGz3jjX1UaBtJQwZaxic4YRbTsR6aEiphFN7DqW gkh+T20sB49n+aELdchqJmgQCofYgj4yaBl8PUfhvtJc7a5BpdV97NJH7vdMRjwJc420 l4V5F4JgPvnea0s89prvEBKlyM/NHqLAhezxj75q+jCJSNH0YL3PdpfQkjS2WFO0wkwr 9yKw== X-Gm-Message-State: AD7BkJLJBZgvsqVtNz8MDEFU3Ns849k5xDiNX0W78sX8/1e2URBCml2oL3iGnc+MhTzopchD X-Received: by 10.28.177.132 with SMTP id a126mr22722573wmf.86.1459349176633; Wed, 30 Mar 2016 07:46:16 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id i5sm4325336wjx.15.2016.03.30.07.46.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Mar 2016 07:46:15 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-mm@kvack.org, akpm@linux-foundation.org, nios2-dev@lists.rocketboards.org, lftan@altera.com, jonas@southpole.se, linux@lists.openrisc.net Subject: [PATCH v2 1/9] arm64: vdso: avoid virt_to_page() translations on kernel symbols Date: Wed, 30 Mar 2016 16:45:56 +0200 Message-Id: <1459349164-27175-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459349164-27175-1-git-send-email-ard.biesheuvel@linaro.org> References: <1459349164-27175-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160330_074638_300922_868C9960 X-CRM114-Status: GOOD ( 12.80 ) 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:235 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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: mark.rutland@arm.com, steve.capper@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The translation performed by virt_to_page() is only valid for linear addresses, and kernel symbols are no longer in the linear mapping. So perform the __pa() translation explicitly, which does the right thing in either case, and only then translate to a struct page offset. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/vdso.c | 4 ++-- 1 file 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/kernel/vdso.c b/arch/arm64/kernel/vdso.c index 97bc68f4c689..64fc030be0f2 100644 --- a/arch/arm64/kernel/vdso.c +++ b/arch/arm64/kernel/vdso.c @@ -131,11 +131,11 @@ static int __init vdso_init(void) return -ENOMEM; /* Grab the vDSO data page. */ - vdso_pagelist[0] = virt_to_page(vdso_data); + vdso_pagelist[0] = pfn_to_page(PHYS_PFN(__pa(vdso_data))); /* Grab the vDSO code pages. */ for (i = 0; i < vdso_pages; i++) - vdso_pagelist[i + 1] = virt_to_page(&vdso_start + i * PAGE_SIZE); + vdso_pagelist[i + 1] = pfn_to_page(PHYS_PFN(__pa(&vdso_start)) + i); /* Populate the special mapping structures */ vdso_spec[0] = (struct vm_special_mapping) {