Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp562341ybf; Wed, 26 Feb 2020 18:34:34 -0800 (PST) X-Google-Smtp-Source: APXvYqw68wutVD7utmlezWrDxjyLKJ4DaQB1rUCaWBCszNRr1j1DL6fjdLCfmAh9PGnZ7IWmsiBZ X-Received: by 2002:a05:6808:4c7:: with SMTP id a7mr1650670oie.83.1582770873969; Wed, 26 Feb 2020 18:34:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582770873; cv=none; d=google.com; s=arc-20160816; b=LZpg7ekEr30562MMxtdZ+LPlFOgr2I5sDEacpRmUuq+8n8eVCdZCm4qPNXmCIzutj6 eZEjli/m4crdj1wB4VJ1vBDNQgrJgnuYEX1wu+CYbEFXThp9SZW/UEy+G3LaY5vuyUKi 8P6T9F0UPfT8UQDX/ZzoRrK6jsnX0VL/vfSojgAcXSZBpOZ/bt6vXkC+Bx/maLbqT8YF p5cAT82vwNAYSo/azv/yj2miYFYAAARYT/O1SINMR/yoMUVoSI3WJ8d+4Dg0WKXuuYPn XiNCYR3g1OsgaLu673OogT8qVU9y1b+DaJOVdAAPWYcXzVdFmof9XrbcpSoswlFvowmE cNuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=B8y16mXH8XEtAUAnOUgG8t+nAh9OcXyht4zpdy9Qh60=; b=GR9w9A6zVIZckiH9x1gV5S9Uuq5iiH+imi4lyRLd4SuZP3bnSX3GtbFG+aEzlAjD+2 Er4fuVcVzboAmd3BdaljhGWJa1RV/Z+gyHVgn9oPDS+d97em/VVKyLWeQIV3R1XwKkPH gHqlVGOzo9wH8h0aW9FJ+c5zZFLUdzZvJW/KHYvJp+T306t81syCL/zFArDWM9OhaqrV Us1bXh1Z/HLXBOSIsrgFhYWDYxdDATykf6Bqj66ymNJf1zSGDZf5EZA6CLSgJXegQ1Us KS/ARr0maS0YYepEWFDRNoGzQwZycV7mel73IGYG+iWlYgG/Rmz5XcLlMKH5BVTfno3f 25Jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f20si578346otl.313.2020.02.26.18.34.21; Wed, 26 Feb 2020 18:34:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728238AbgB0CeT (ORCPT + 99 others); Wed, 26 Feb 2020 21:34:19 -0500 Received: from foss.arm.com ([217.140.110.172]:44794 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728164AbgB0CeS (ORCPT ); Wed, 26 Feb 2020 21:34:18 -0500 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: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >