Return-Path: From: Anshuman Khandual Subject: Re: [PATCH V14] mm/debug: Add tests validating architecture page table helpers 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 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+rppt=linux.ibm.com@lists.infradead.org To: Christophe Leroy , Qian Cai , linux-mm@kvack.org Cc: Catalin Marinas , Heiko Carstens , Paul Mackerras , "H. Peter Anvin" , linux-riscv@lists.infradead.org, Will Deacon , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michael Ellerman , x86@kernel.org, Mike Rapoport , Christian Borntraeger , Ingo Molnar , Benjamin Herrenschmidt , James Morse , linux-snps-arc@lists.infradead.org, Vasily Gorbik , Borislav Petkov , Paul Walmsley , "Kirill A . Shutemov" , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Vineet Gupta , linux-kernel@vger.kernel.org, Palmer Dabbelt , Andrew Morton , linuxppc-dev@lists.ozlabs.org List-ID: Message-ID: <20200227023405.syp--RKaM34QGhMTJh4v81OKNwtBZaLgZOeis3cy258@z> On 02/26/2020 08:14 PM, Christophe Leroy wrote: > > > Le 26/02/2020 à 15:12, Qian Cai a écrit : >> 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, >> >> [  146.634626][    T1] debug_vm_pgtable: debug_vm_pgtable: Validating >> architecture page table helpers >> [  146.643995][    T1] ------------[ cut here ]------------ >> [  146.649350][    T1] virt_to_phys used for non-linear address: >> (____ptrval____) (start_kernel+0x0/0x580) > > Must be something wrong with the following in debug_vm_pgtable() > >     paddr = __pa(&start_kernel); > > 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 symbol i.e 'start_kernel' which might be outside the linear map. This happens due to kernel mapping position randomization with KASLR. Adding James here in case he might like to add more. __pa_symbol() should have been used instead, for accessing the physical address 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 already part of linux-next (next-20200226). But can definitely respin if that will be preferred. Thanks Qian for catching this. > > Christophe >