From patchwork Thu Feb 27 04:00:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 11407715 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C0F2924 for ; Thu, 27 Feb 2020 04:00:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D5DA82467F for ; Thu, 27 Feb 2020 04:00:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5DA82467F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 19FA26B0003; Wed, 26 Feb 2020 23:00:43 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 1508A6B0005; Wed, 26 Feb 2020 23:00:43 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0667B6B0006; Wed, 26 Feb 2020 23:00:43 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0159.hostedemail.com [216.40.44.159]) by kanga.kvack.org (Postfix) with ESMTP id E00226B0003 for ; Wed, 26 Feb 2020 23:00:42 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id AD190181AC217 for ; Thu, 27 Feb 2020 04:00:42 +0000 (UTC) X-FDA: 76534555524.15.spoon63_627ab2e9c630 X-Spam-Summary: 30,2,0,094a80ccb86d5baf,d41d8cd98f00b204,anshuman.khandual@arm.com,,RULES_HIT:41:69:334:355:368:369:379:541:569:800:960:973:988:989:1260:1261:1345:1431:1437:1534:1542:1711:1730:1747:1777:1792:1963:2393:2559:2562:2771:3138:3139:3140:3141:3142:3354:3865:3867:3868:3870:3871:3872:4321:4605:5007:6117:6261:7903:7904:8634:8660:8784:9036:9163:9165:9391:10004:11026:11232:11658:11914:12043:12296:12297:12555:12895:12986:13148:13221:13229:13230:13870:14096:14181:14394:14721:21080:21433:21451:21627:21939:30003:30029:30054:30056:30089,0,RBL:217.140.110.172:@arm.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: spoon63_627ab2e9c630 X-Filterd-Recvd-Size: 3908 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Thu, 27 Feb 2020 04:00:42 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C328130E; Wed, 26 Feb 2020 20:00:40 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.1.119]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C76033F73B; Wed, 26 Feb 2020 20:00:38 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org Cc: Anshuman Khandual , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH] mm/debug: Replace __pa() with __pa_symbol() in debug_vm_pgtable() Date: Thu, 27 Feb 2020 09:30:31 +0530 Message-Id: <1582776031-30344-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Replace __pa() with __pa_symbol() in debug_vm_pgtable() while accessing the physical address for 'start_kernel' which is a kernel text symbol, else it might trigger the following warning on some platforms when DEBUG_VIRTUAL is enabled. [ 23.123852] ------------[ cut here ]------------ [ 23.124486] virt_to_phys used for non-linear address: (____ptrval____) (start_kernel+0x0/0x424) [ 23.125663] WARNING: CPU: 11 PID: 1 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x60/0x98 [ 23.126877] Modules linked in: [ 23.127390] CPU: 11 PID: 1 Comm: swapper/0 Tainted: G W 5.6.0-rc3-next-20200226-00001-g306225cc6ffd #163 [ 23.129139] Hardware name: linux,dummy-virt (DT) [ 23.129898] pstate: 60400005 (nZCv daif +PAN -UAO) [ 23.130693] pc : __virt_to_phys+0x60/0x98 [ 23.131359] lr : __virt_to_phys+0x60/0x98 [ 23.132022] sp : ffff800011e6be10 [ 23.132575] x29: ffff800011e6be10 x28: 0000000000000000 [ 23.133447] x27: 0000000000000000 x26: 0000000000000000 [ 23.134319] x25: 0000000000000000 x24: 0020000000000fd3 [ 23.135197] x23: fffffe000bd27700 x22: ffff0002fcae8000 [ 23.136069] x21: ffff800011a47000 x20: 0000000000000001 [ 23.136941] x19: ffff800011350a14 x18: 0000000000000010 [ 23.137815] x17: 000000006bb8910e x16: 00000000a1fdc699 [ 23.138693] x15: ffffffffffffffff x14: 6c656e72656b5f74 [ 23.139567] x13: 726174732820295f x12: 5f5f5f6c61767274 [ 23.140441] x11: 705f5f5f5f28203a x10: 7373657264646120 [ 23.141314] x9 : 7261656e696c2d6e x8 : ffff8000106b4e70 [ 23.142189] x7 : 00000000000002a1 x6 : ffff800011a58bba [ 23.143067] x5 : 001fffffffffffff x4 : 0000000000000000 [ 23.143939] x3 : 00000000ffffffff x2 : ffff800011881bf8 [ 23.144810] x1 : 16ee3f9cb03efc00 x0 : 0000000000000000 [ 23.145682] Call trace: [ 23.146097] __virt_to_phys+0x60/0x98 [ 23.146710] debug_vm_pgtable+0xd0/0x440 [ 23.147362] kernel_init+0x18/0x100 [ 23.147944] ret_from_fork+0x10/0x18 [ 23.148539] ---[ end trace fc4ccb3cb35ff225 ]--- Cc: Andrew Morton Cc: linux-kernel@vger.kernel.org Reported-by: Qian Cai Signed-off-by: Anshuman Khandual --- This applies on linux-next (next-20200226). Tested on arm64 and x86 platforms. Build tested on several others. mm/debug_vm_pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index cdfab040c1f6..9d1c8570fa00 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -585,7 +585,7 @@ void __init debug_vm_pgtable(void) * helps avoid large memory block allocations to be used for mapping * at higher page table levels. */ - paddr = __pa(&start_kernel); + paddr = __pa_symbol(&start_kernel); pte_aligned = (paddr & PAGE_MASK) >> PAGE_SHIFT; pmd_aligned = (paddr & PMD_MASK) >> PAGE_SHIFT;