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.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 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 17D4DECE588 for ; Tue, 15 Oct 2019 14:41:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B5A9320854 for ; Tue, 15 Oct 2019 14:41:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="AtgdjehM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5A9320854 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 612848E0006; Tue, 15 Oct 2019 10:41:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F32A8E0001; Tue, 15 Oct 2019 10:41:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5008C8E0006; Tue, 15 Oct 2019 10:41:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0061.hostedemail.com [216.40.44.61]) by kanga.kvack.org (Postfix) with ESMTP id 2FD8B8E0001 for ; Tue, 15 Oct 2019 10:41:50 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id BE037181BCDB6 for ; Tue, 15 Oct 2019 14:41:49 +0000 (UTC) X-FDA: 76046283138.08.order93_4a05ac7ef6f2c X-HE-Tag: order93_4a05ac7ef6f2c X-Filterd-Recvd-Size: 13030 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Tue, 15 Oct 2019 14:41:48 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id m15so30943090qtq.2 for ; Tue, 15 Oct 2019 07:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=KOthtKc750ha5x4f9O1nDtFHxGzvuirdOiPTMzSqTsk=; b=AtgdjehMIW2BLhP3jeK/qmKXq2+AXxzyWeIH6bKw4O3o0bC6XJQt+cAWIC0yMh6wiP SupmvGOupyWxPBHXOSFIRoapYlzZ1hYO8VI7pDOCxTY/Dx1Dgrvi2XOEp2yl+LhIOEHT u2tYUEb7UC7Y+OmoO377QG3dWxUE+13skl13Dwf1FBQ4rIPA/dbKnr+HRCDUS7FZtcdV L3b45BZgHc50mOaywiqTTOXCkKt7paRreX5ny4ScY/osK3vBY9jN0JO82EN8FpMzG1Nn DuZelOJa5PuYyzq9v5gfHBe8i4OKeqTjui1sMrU6aselqYDmxj1po/GPeKBXBAMZGEJa 1g3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=KOthtKc750ha5x4f9O1nDtFHxGzvuirdOiPTMzSqTsk=; b=qFSX7TKGb2b3gsvsdSLsMEKt29+s4daepE2OZFLh++umtpikq8GO5IBT3f1JlT7SCM YU2u3WKlDWxqp8iLTIJSManV54GwDGFn0ejJM93QKQvbaexU1Fdqgq9T5K8EIwq+9wFO f2AzvdeC4S/uIgS34MUSyZpDWKWIbGYrBOdSXNs3mEZPFHYDeOurYFZetk6YhYIT5m+9 0v03Wpc2sA10C16tfJEYaR7LpiSo+IoCSXcwTdX1KPv/7qXGjd63jYg6LOboO5eNQ3gT TsckfrA83xCI+pOdmjALSqLPBsCc44Xj0gYZWjCcuahL3a1ZsSP271R+pa9f9b4SPT6p 9mIQ== X-Gm-Message-State: APjAAAW+hFOF5Pq/luiTyTKrsvijhH+UIGgez14D5QtdKvHUzMGArIVF 2GRnLnjQwpcSm4k0iopsVF6CilVcEJI= X-Google-Smtp-Source: APXvYqz1jaDLsZXCujEQqKw2NmGGpxtStBi3XubJKmoqx4STHaHJWThY1IvGZuOPXBVemA+XaCvAzg== X-Received: by 2002:ac8:6ede:: with SMTP id f30mr38381128qtv.205.1571150507816; Tue, 15 Oct 2019 07:41:47 -0700 (PDT) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id z200sm10605390qkb.5.2019.10.15.07.41.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Oct 2019 07:41:47 -0700 (PDT) Message-ID: <1571150502.5937.39.camel@lca.pw> Subject: Re: [PATCH V6 0/2] mm/debug: Add tests validating architecture page table helpers From: Qian Cai To: Anshuman Khandual , linux-mm@kvack.org Cc: Andrew Morton , 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 , Sri Krishna chowdary , Dave Hansen , Russell King - ARM Linux , Michael Ellerman , Paul Mackerras , Martin Schwidefsky , Heiko Carstens , "David S. Miller" , Vineet Gupta , James Hogan , Paul Burton , Ralf Baechle , "Kirill A . Shutemov" , Gerald Schaefer , Christophe Leroy , Mike Kravetz , 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 Date: Tue, 15 Oct 2019 10:41:42 -0400 In-Reply-To: <1571131302-32290-1-git-send-email-anshuman.khandual@arm.com> References: <1571131302-32290-1-git-send-email-anshuman.khandual@arm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 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: The x86 will crash with linux-next during boot due to this series (v5) wi= th the config below plus CONFIG_DEBUG_VM_PGTABLE=3Dy. I am not sure if v6 would = address it. https://raw.githubusercontent.com/cailca/linux-mm/master/x86.config [=C2=A0=C2=A0=C2=A033.862600][=C2=A0=C2=A0=C2=A0=C2=A0T1] page:ffffea0009= 000000 is uninitialized and poisoned [=C2=A0=C2=A0=C2=A033.862608][=C2=A0=C2=A0=C2=A0=C2=A0T1] raw: ffffffffff= ffffff ffffffffffffffff ffffffffffffffff ffffff871140][=C2=A0=C2=A0=C2=A0=C2=A0T1]=C2=A0=C2=A0? _raw_spin_unlock_i= rq+0x27/0x40 [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1]=C2=A0=C2=A0? re= st_init+0x307/0x307 [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1]=C2=A0=C2=A0kern= el_init+0x11/0x139 [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1]=C2=A0=C2=A0? re= st_init+0x307/0x307 [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1]=C2=A0=C2=A0ret_= from_fork+0x27/0x50 [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1] Modules linked = in: [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1] ---[ end trace = e99d392b0f7befbd ]--- [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1] RIP: 0010:alloc= _gigantic_page_order+0x3fe/0x490 On Tue, 2019-10-15 at 14:51 +0530, Anshuman Khandual wrote: > This series adds a test validation for architecture exported page table > helpers. Patch in the series adds basic transformation tests at various > levels of the page table. Before that it exports gigantic page allocati= on > function from HugeTLB. >=20 > This test was originally suggested by Catalin during arm64 THP migratio= n > RFC discussion earlier. Going forward it can include more specific test= s > with respect to various generic MM functions like THP, HugeTLB etc and > platform specific tests. >=20 > https://lore.kernel.org/linux-mm/20190628102003.GA56463@arrakis.emea.ar= m.com/ >=20 > Changes in V6: >=20 > - Moved alloc_gigantic_page_order() into mm/page_alloc.c per Michal > - Moved alloc_gigantic_page_order() within CONFIG_CONTIG_ALLOC in the t= est > - Folded Andrew's include/asm-generic/pgtable.h fix into the test patch= 2/2 >=20 > Changes in V5: (https://patchwork.kernel.org/project/linux-mm/list/?ser= ies=3D185991) >=20 > - Redefined and moved X86 mm_p4d_folded() into a different header per K= irill/Ingo > - Updated the config option comment per Ingo and dropped 'kernel module= ' reference > - Updated the commit message and dropped 'kernel module' reference > - Changed DEBUG_ARCH_PGTABLE_TEST into DEBUG_VM_PGTABLE per Ingo > - Moved config option from mm/Kconfig.debug into lib/Kconfig.debug > - Renamed core test function arch_pgtable_tests() as debug_vm_pgtable() > - Renamed mm/arch_pgtable_test.c as mm/debug_vm_pgtable.c > - debug_vm_pgtable() gets called from kernel_init_freeable() after init= _mm_internals() > - Added an entry in Documentation/features/debug/ per Ingo > - Enabled the test on arm64 and x86 platforms for now >=20 > Changes in V4: (https://patchwork.kernel.org/project/linux-mm/list/?ser= ies=3D183465) >=20 > - Disable DEBUG_ARCH_PGTABLE_TEST for ARM and IA64 platforms >=20 > Changes in V3: (https://lore.kernel.org/patchwork/project/lkml/list/?se= ries=3D411216) >=20 > - Changed test trigger from module format into late_initcall() > - Marked all functions with __init to be freed after completion > - Changed all __PGTABLE_PXX_FOLDED checks as mm_pxx_folded() > - Folded in PPC32 fixes from Christophe >=20 > Changes in V2: >=20 > https://lore.kernel.org/linux-mm/1568268173-31302-1-git-send-email-ansh= uman.khandual@arm.com/T/#t >=20 > - Fixed small typo error in MODULE_DESCRIPTION() > - Fixed m64k build problems for lvalue concerns in pmd_xxx_tests() > - Fixed dynamic page table level folding problems on x86 as per Kirril > - Fixed second pointers during pxx_populate_tests() per Kirill and Gera= ld > - Allocate and free pte table with pte_alloc_one/pte_free per Kirill > - Modified pxx_clear_tests() to accommodate s390 lower 12 bits situatio= n > - Changed RANDOM_NZVALUE value from 0xbe to 0xff > - Changed allocation, usage, free sequence for saved_ptep > - Renamed VMA_FLAGS as VMFLAGS > - Implemented a new method for random vaddr generation > - Implemented some other cleanups > - Dropped extern reference to mm_alloc() > - Created and exported new alloc_gigantic_page_order() > - Dropped the custom allocator and used new alloc_gigantic_page_order() >=20 > Changes in V1: >=20 > https://lore.kernel.org/linux-mm/1567497706-8649-1-git-send-email-anshu= man.khandual@arm.com/ >=20 > - Added fallback mechanism for PMD aligned memory allocation failure >=20 > Changes in RFC V2: >=20 > https://lore.kernel.org/linux-mm/1565335998-22553-1-git-send-email-ansh= uman.khandual@arm.com/T/#u >=20 > - Moved test module and it's config from lib/ to mm/ > - Renamed config TEST_ARCH_PGTABLE as DEBUG_ARCH_PGTABLE_TEST > - Renamed file from test_arch_pgtable.c to arch_pgtable_test.c > - Added relevant MODULE_DESCRIPTION() and MODULE_AUTHOR() details > - Dropped loadable module config option > - Basic tests now use memory blocks with required size and alignment > - PUD aligned memory block gets allocated with alloc_contig_range() > - If PUD aligned memory could not be allocated it falls back on PMD ali= gned > memory block from page allocator and pud_* tests are skipped > - Clear and populate tests now operate on real in memory page table ent= ries > - Dummy mm_struct gets allocated with mm_alloc() > - Dummy page table entries get allocated with [pud|pmd|pte]_alloc_[map]= () > - Simplified [p4d|pgd]_basic_tests(), now has random values in the entr= ies >=20 > Original RFC V1: >=20 > https://lore.kernel.org/linux-mm/1564037723-26676-1-git-send-email-ansh= uman.khandual@arm.com/ >=20 > Cc: Andrew Morton > Cc: Vlastimil Babka > Cc: Greg Kroah-Hartman > Cc: Thomas Gleixner > Cc: Mike Rapoport > Cc: Jason Gunthorpe > Cc: Dan Williams > Cc: Peter Zijlstra > Cc: Michal Hocko > Cc: Mark Rutland > Cc: Mark Brown > Cc: Steven Price > Cc: Ard Biesheuvel > Cc: Masahiro Yamada > Cc: Kees Cook > Cc: Tetsuo Handa > Cc: Matthew Wilcox > Cc: Sri Krishna chowdary > Cc: Dave Hansen > Cc: Russell King - ARM Linux > Cc: Michael Ellerman > Cc: Paul Mackerras > Cc: Martin Schwidefsky > Cc: Heiko Carstens > Cc: "David S. Miller" > Cc: Vineet Gupta > Cc: James Hogan > Cc: Paul Burton > Cc: Ralf Baechle > Cc: Kirill A. Shutemov > Cc: Gerald Schaefer > Cc: Christophe Leroy > Cc: Mike Kravetz > Cc: linux-snps-arc@lists.infradead.org > Cc: linux-mips@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-ia64@vger.kernel.org > Cc: linuxppc-dev@lists.ozlabs.org > Cc: linux-s390@vger.kernel.org > Cc: linux-sh@vger.kernel.org > Cc: sparclinux@vger.kernel.org > Cc: x86@kernel.org > Cc: linux-kernel@vger.kernel.org >=20 >=20 > Anshuman Khandual (2): > mm/page_alloc: Make alloc_gigantic_page() available for general use > mm/debug: Add tests validating architecture page table helpers >=20 > .../debug/debug-vm-pgtable/arch-support.txt | 34 ++ > arch/arm64/Kconfig | 1 + > arch/x86/Kconfig | 1 + > arch/x86/include/asm/pgtable_64.h | 6 + > include/asm-generic/pgtable.h | 6 + > include/linux/gfp.h | 3 + > init/main.c | 1 + > lib/Kconfig.debug | 21 + > mm/Makefile | 1 + > mm/debug_vm_pgtable.c | 450 ++++++++++++++++++ > mm/hugetlb.c | 76 +-- > mm/page_alloc.c | 98 ++++ > 12 files changed, 623 insertions(+), 75 deletions(-) > create mode 100644 Documentation/features/debug/debug-vm-pgtable/arch-= support.txt > create mode 100644 mm/debug_vm_pgtable.c >=20