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=-7.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 5076EC352A3 for ; Mon, 10 Feb 2020 10:46:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DFBA220863 for ; Mon, 10 Feb 2020 10:46:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=c-s.fr header.i=@c-s.fr header.b="RdSNVpl3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFBA220863 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=c-s.fr Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 923CE6B00E3; Mon, 10 Feb 2020 05:46:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8FC6C6B00E5; Mon, 10 Feb 2020 05:46:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7EB5E6B00E6; Mon, 10 Feb 2020 05:46:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by kanga.kvack.org (Postfix) with ESMTP id 6658F6B00E3 for ; Mon, 10 Feb 2020 05:46:33 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 009398248047 for ; Mon, 10 Feb 2020 10:46:32 +0000 (UTC) X-FDA: 76473888624.20.sand34_56290beaf0f55 X-HE-Tag: sand34_56290beaf0f55 X-Filterd-Recvd-Size: 10402 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Mon, 10 Feb 2020 10:46:31 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48GMyn4XNDzB09b8; Mon, 10 Feb 2020 11:46:25 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=RdSNVpl3; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 2YKBWszaeG8b; Mon, 10 Feb 2020 11:46:25 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48GMyn31lmzB09b6; Mon, 10 Feb 2020 11:46:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1581331585; bh=3VdT8leEAlfSLQpPQKoxenZVPWjYs1yN+U09thgTRJA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=RdSNVpl3eRdV3gPJ7XDvUegm6wZGug8ejVpKq74HLxDjFS3pwYqC+BZGFoUQ1Oq78 SVulkxR8i/NmQfPxXj9q1ZP6MDJ4/eVa8ThwXr9rdv9XZ0ODywoTCAXN5cQTc5KVGa aEm6pzX4mgbIsgNXEcKTlXONuuV1vYFncq9hDwgQ= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 295478B7B8; Mon, 10 Feb 2020 11:46:29 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id VHUUj31ZCU6T; Mon, 10 Feb 2020 11:46:29 +0100 (CET) Received: from [172.25.230.102] (po15451.idsi0.si.c-s.fr [172.25.230.102]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6A8808B7B5; Mon, 10 Feb 2020 11:46:23 +0100 (CET) Subject: Re: [PATCH V13] mm/debug: Add tests validating architecture page table helpers To: Russell King - ARM Linux admin Cc: Anshuman Khandual , Andrew Morton , kbuild test robot , kbuild-all@lists.01.org, linux-mm@kvack.org, Vlastimil Babka , Greg Kroah-Hartman , Thomas Gleixner , Mike Rapoport , Jason Gunthorpe , Dan Williams , Peter Zijlstra , Michal Hocko , Mark Rutland , Mark Brown , Steven Price , Ard Biesheuvel , Masahiro Yamada , Kees Cook , Tetsuo Handa , Matthew Wilcox , Dave Hansen , Michael Ellerman , Paul Mackerras , Martin Schwidefsky , Heiko Carstens , "David S. Miller" , Vineet Gupta , James Hogan , Paul Burton , Ralf Baechle , "Kirill A . Shutemov" , Gerald Schaefer , Ingo Molnar , Richard Henderson , Ivan Kokshaysky , Matt Turner , Mark Salter , Aurelien Jacquiot , Yoshinori Sato , Brian Cain , Geert Uytterhoeven , Michal Simek , Paul Walmsley , Palmer Dabbelt , Guan Xuetao , Chris Zankel , Max Filippov , Qian Cai , linux-alpha@vger.kernel.org, linux-c6x-dev@linux-c6x.org, uclinux-h8-devel@lists.sourceforge.jp, linux-hexagon@vger.kernel.org, linux-m68k@vger.kernel.org, linux-riscv@lists.infradead.org, linux-xtensa@linux-xtensa.org, linux-snps-arc@lists.infradead.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org References: <1580897674-16456-1-git-send-email-anshuman.khandual@arm.com> <202002060619.wEOdAZU1%lkp@intel.com> <78d3ce6b-e100-2561-6b09-124c29731d1a@arm.com> <20200209205231.44d098f8749e88190b8ba10c@linux-foundation.org> <955229f7-f161-f720-0e75-a3163f63817d@arm.com> <20200210100200.GB25745@shell.armlinux.org.uk> From: Christophe Leroy Message-ID: <7cb3a5bb-eaea-a01c-4047-e3c000b7ad1d@c-s.fr> Date: Mon, 10 Feb 2020 11:46:23 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200210100200.GB25745@shell.armlinux.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr 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: Le 10/02/2020 =C3=A0 11:02, Russell King - ARM Linux admin a =C3=A9crit=C2= =A0: > On Mon, Feb 10, 2020 at 07:38:38AM +0100, Christophe Leroy wrote: >> >> >> Le 10/02/2020 =C3=A0 06:35, Anshuman Khandual a =C3=A9crit=C2=A0: >>> >>> >>> On 02/10/2020 10:22 AM, Andrew Morton wrote: >>>> On Thu, 6 Feb 2020 13:49:35 +0530 Anshuman Khandual wrote: >>>> >>>>> >>>>> On 02/06/2020 04:40 AM, kbuild test robot wrote: >>>>>> Hi Anshuman, >>>>>> >>>>>> Thank you for the patch! Yet something to improve: >>>>>> >>>>>> [auto build test ERROR on powerpc/next] >>>>>> [also build test ERROR on s390/features linus/master arc/for-next = v5.5] >>>>>> [cannot apply to mmotm/master tip/x86/core arm64/for-next/core nex= t-20200205] >>>>>> [if your patch is applied to the wrong git tree, please drop us a = note to help >>>>>> improve the system. BTW, we also suggest to use '--base' option to= specify the >>>>>> base tree in git format-patch, please see https://stackoverflow.co= m/a/37406982] >>>>>> >>>>>> url: https://github.com/0day-ci/linux/commits/Anshuman-Khandual= /mm-debug-Add-tests-validating-architecture-page-table-helpers/20200205-2= 15507 >>>>>> base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/li= nux.git next >>>>>> config: ia64-allmodconfig (attached as .config) >>>>>> compiler: ia64-linux-gcc (GCC) 7.5.0 >>>>>> reproduce: >>>>>> wget https://raw.githubusercontent.com/intel/lkp-tests/m= aster/sbin/make.cross -O ~/bin/make.cross >>>>>> chmod +x ~/bin/make.cross >>>>>> # save the attached .config to linux build tree >>>>>> GCC_VERSION=3D7.5.0 make.cross ARCH=3Dia64 >>>>>> >>>>>> If you fix the issue, kindly add following tag >>>>>> Reported-by: kbuild test robot >>>>>> >>>>>> All error/warnings (new ones prefixed by >>): >>>>>> >>>>>> In file included from include/asm-generic/pgtable-nopud.h:8:0= , >>>>>> from arch/ia64/include/asm/pgtable.h:586, >>>>>> from include/linux/mm.h:99, >>>>>> from include/linux/highmem.h:8, >>>>>> from mm/debug_vm_pgtable.c:14: >>>>>> mm/debug_vm_pgtable.c: In function 'pud_clear_tests': >>>>>>>> include/asm-generic/pgtable-nop4d-hack.h:47:32: error: implicit = declaration of function '__pgd'; did you mean '__p4d'? [-Werror=3Dimplici= t-function-declaration] >>>>>> #define __pud(x) ((pud_t) { __pgd(x) }) >>>>>> ^ >>>>>>>> mm/debug_vm_pgtable.c:141:8: note: in expansion of macro '__pud' >>>>>> pud =3D __pud(pud_val(pud) | RANDOM_ORVALUE); >>>>>> ^~~~~ >>>>>>>> include/asm-generic/pgtable-nop4d-hack.h:47:22: warning: missing= braces around initializer [-Wmissing-braces] >>>>>> #define __pud(x) ((pud_t) { __pgd(x) }) >>>>>> ^ >>>>>>>> mm/debug_vm_pgtable.c:141:8: note: in expansion of macro '__pud' >>>>>> pud =3D __pud(pud_val(pud) | RANDOM_ORVALUE); >>>>>> ^~~~~ >>>>>> cc1: some warnings being treated as errors >>>>> >>>>> This build failure is expected now given that we have allowed DEBUG= _VM_PGTABLE >>>>> with EXPERT without platform requiring ARCH_HAS_DEBUG_VM_PGTABLE. T= his problem >>>>> i.e build failure caused without a platform __pgd(), is known to ex= ist both on >>>>> ia64 and arm (32bit) platforms. Please refer https://lkml.org/lkml/= 2019/9/24/314 >>>>> for details where this was discussed earlier. >>>>> >>>> >>>> I'd prefer not to merge a patch which is known to cause build >>>> regressions. Is there some temporary thing we can do to prevent the= se >>>> errors until arch maintainers(?) get around to implementing the >>>> long-term fixes? >>> >>> We could explicitly disable CONFIG_DEBUG_VM_PGTABLE on ia64 and arm p= latforms >>> which will ensure that others can still use the EXPERT path. >>> >>> config DEBUG_VM_PGTABLE >>> bool "Debug arch page table for semantics compliance" >>> depends on MMU >>> depends on !(IA64 || ARM) >>> depends on ARCH_HAS_DEBUG_VM_PGTABLE || EXPERT >>> default n if !ARCH_HAS_DEBUG_VM_PGTABLE >>> default y if DEBUG_VM >>> >> >> On both ia32 and arm, the fix is trivial. >> >> Can we include the fix within this patch, just the same way as the >> mm_p4d_folded() fix for x86 ? >=20 > Why should arm include a macro for something that nothing (apart from > this checker) requires? If the checker requires it but the rest of > the kernel does not, it suggests that the checker isn't actually > correct, and the results can't be relied upon. >=20 As far as I can see, the problem is that arm opencodes part of the API=20 instead of including asm-generic/pgtable-nopmd.h Here, the ARM has 2 levels, ie only PGD and PTE. But instead of defining=20 __pgd and __pte and getting everything else from asm-generic, it defines=20 a __pmd then redefines the folded levels like the pud, etc ... That's exactly what the checker aims at detecting: architectures than do=20 not properly use the standard linux page table structures. Christophe