From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 564B1C4BA24 for ; Thu, 27 Feb 2020 02:34:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 075DD208E4 for ; Thu, 27 Feb 2020 02:34:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 075DD208E4 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 981326B0003; Wed, 26 Feb 2020 21:34:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9317F6B0005; Wed, 26 Feb 2020 21:34:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 81F746B0006; Wed, 26 Feb 2020 21:34:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0156.hostedemail.com [216.40.44.156]) by kanga.kvack.org (Postfix) with ESMTP id 6837F6B0003 for ; Wed, 26 Feb 2020 21:34:17 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2228B181AEF07 for ; Thu, 27 Feb 2020 02:34:17 +0000 (UTC) X-FDA: 76534337754.18.net59_7cab4db9e3627 X-HE-Tag: net59_7cab4db9e3627 X-Filterd-Recvd-Size: 4103 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Thu, 27 Feb 2020 02:34:16 +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 A9D9F1FB; Wed, 26 Feb 2020 18:34:15 -0800 (PST) Received: from [10.163.1.119] (unknown [10.163.1.119]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6D8323F819; Wed, 26 Feb 2020 18:34:06 -0800 (PST) From: Anshuman Khandual Subject: Re: [PATCH V14] mm/debug: Add tests validating architecture page table helpers To: Christophe Leroy , Qian Cai , linux-mm@kvack.org Cc: Andrew Morton , Mike Rapoport , Vineet Gupta , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "Kirill A . Shutemov" , Paul Walmsley , Palmer Dabbelt , linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, James Morse References: <1581909460-19148-1-git-send-email-anshuman.khandual@arm.com> <1582726182.7365.123.camel@lca.pw> <1582726340.7365.124.camel@lca.pw> Message-ID: <52db1e9b-83b3-c41f-ef03-0f43e2159a83@arm.com> Date: Thu, 27 Feb 2020 08:04:05 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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: On 02/26/2020 08:14 PM, Christophe Leroy wrote: >=20 >=20 > Le 26/02/2020 =C3=A0 15:12, Qian Cai a =C3=A9crit=C2=A0: >> On Wed, 2020-02-26 at 09:09 -0500, Qian Cai wrote: >>> On Mon, 2020-02-17 at 08:47 +0530, Anshuman Khandual wrote: >>> >>> How useful is this that straightly crash the powerpc? >> >> And then generate warnings on arm64, >> >> [=C2=A0=C2=A0146.634626][=C2=A0=C2=A0=C2=A0=C2=A0T1] debug_vm_pgtable:= debug_vm_pgtable: Validating >> architecture page table helpers >> [=C2=A0=C2=A0146.643995][=C2=A0=C2=A0=C2=A0=C2=A0T1] ------------[ cut= here ]------------ >> [=C2=A0=C2=A0146.649350][=C2=A0=C2=A0=C2=A0=C2=A0T1] virt_to_phys used= for non-linear address: >> (____ptrval____) (start_kernel+0x0/0x580) >=20 > Must be something wrong with the following in debug_vm_pgtable() >=20 > =C2=A0=C2=A0=C2=A0=C2=A0paddr =3D __pa(&start_kernel); >=20 > Is there any explaination why start_kernel() is not in linear memory on= ARM64 ? Cc: + James Morse This warning gets exposed with DEBUG_VIRTUAL due to __pa() on a kernel sy= mbol i.e 'start_kernel' which might be outside the linear map. This happens du= e to kernel mapping position randomization with KASLR. Adding James here in ca= se he might like to add more. __pa_symbol() should have been used instead, for accessing the physical a= ddress here. On arm64 __pa() does check for linear address with __is_lm_address(= ) and switch accordingly if it is a kernel text symbol. Nevertheless, its much = better to use __pa_symbol() here rather than __pa(). Rather than respining the patch once more, will just send a fix replacing= this helper __pa() with __pa_symbol() for Andrew to pick up as this patch is a= lready part of linux-next (next-20200226). But can definitely respin if that wil= l be preferred. Thanks Qian for catching this. >=20 > Christophe >=20