Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1233500ybx; Tue, 5 Nov 2019 12:36:03 -0800 (PST) X-Google-Smtp-Source: APXvYqwu7/YLbhO2GaX3tgDWbsku8Yw59lapfNloiGPapXcDUfaDHjATkiR8eBl1PVY683EGfbn6 X-Received: by 2002:a05:6402:2029:: with SMTP id ay9mr9544019edb.47.1572986163008; Tue, 05 Nov 2019 12:36:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572986163; cv=none; d=google.com; s=arc-20160816; b=viAuhtzX14RDPmH1oMZgWbtUpq4DZOAsD2vyOfKJJg+YSR+9HyNVOh3s/06Zm2aon5 065SKSvh1aQSFCcUDFBJXvLmtFI6E/3fsW8hdl4NJ7LyGHcwc9cGFdhfgqFKcIV36iwN UtSmCpqK5jiPtVRQPnHeDX7GEknKEd48iEGHGjMWoWgxK6GC8Ft5MnhLRcoDLTBo34IJ 0iW1ttFpCbAwZppAM1qjOfg4HgM82vuQ32fLbv3MV51Prd/VHWHB3D9kJGwg2eyb3Qg1 OLD3sfvnq1q3D7+oFPfootNlFDMhcI2tb7c448dSxi3BVFWG6ad3CbQLsgMMqmPJAv/8 sJlw== 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:from:references:cc:to:subject; bh=+9iQv5UKFskx1HKHfswPrIP9aScfm9v03QR0DVb807s=; b=ASmacisNPNIgLqQbU3A1L1Dn22RvWCgLQCxXvkl6al19hZ69opctXtTLDpNucwgCVV 2DdN2FW4D56mFiddPouiWgdEOYf0m5NkRGg7G07a6NUlKjlV86sOMnCgkD+xsLuHNRHt Swfo7duBwO+yKbYeQbNgP/VwC7Xq8rYdo02ysZYxjHFGMTUnXE5bEmXnnKWRIssx0+d2 RMTky0ye1LeqTGHgMlNJLe9Qw8fO6QNNw8bBx1COPoOlQG7ZN+gRby0Q29aYAZnq7XGR n+IFXHyA0j+fytZnnTZtL8pczoDby2yGD3ma+6wJHsIZt5+j8MCLpZ+QywLVTiaAK3AZ pLjg== 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 ot22si14131337ejb.166.2019.11.05.12.35.39; Tue, 05 Nov 2019 12:36:02 -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 S1729753AbfKEUfF (ORCPT + 99 others); Tue, 5 Nov 2019 15:35:05 -0500 Received: from foss.arm.com ([217.140.110.172]:60270 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbfKEUe5 (ORCPT ); Tue, 5 Nov 2019 15:34:57 -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 7F2DD8E6; Tue, 5 Nov 2019 12:34:56 -0800 (PST) Received: from [192.168.225.149] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 178C53F95D; Mon, 4 Nov 2019 16:00:07 -0800 (PST) Subject: Re: [PATCH V8] mm/debug: Add tests validating architecture page table helpers To: linux-mm@kvack.org, Andrew Morton Cc: 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 , Ingo Molnar , 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, Michal Hocko , Matthew Wilcox References: <1572240562-23630-1-git-send-email-anshuman.khandual@arm.com> From: Anshuman Khandual Message-ID: Date: Tue, 5 Nov 2019 05:30:41 +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: <1572240562-23630-1-git-send-email-anshuman.khandual@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/28/2019 10:59 AM, Anshuman Khandual wrote: > This adds tests which will validate architecture page table helpers and > other accessors in their compliance with expected generic MM semantics. > This will help various architectures in validating changes to existing > page table helpers or addition of new ones. > > This test covers basic page table entry transformations including but not > limited to old, young, dirty, clean, write, write protect etc at various > level along with populating intermediate entries with next page table page > and validating them. > > Test page table pages are allocated from system memory with required size > and alignments. The mapped pfns at page table levels are derived from a > real pfn representing a valid kernel text symbol. This test gets called > right after page_alloc_init_late(). > > This gets build and run when CONFIG_DEBUG_VM_PGTABLE is selected along with > CONFIG_VM_DEBUG. Architectures willing to subscribe this test also need to > select CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE which for now is limited to x86 and > arm64. Going forward, other architectures too can enable this after fixing > build or runtime problems (if any) with their page table helpers. > > Folks interested in making sure that a given platform's page table helpers > conform to expected generic MM semantics should enable the above config > which will just trigger this test during boot. Any non conformity here will > be reported as an warning which would need to be fixed. This test will help > catch any changes to the agreed upon semantics expected from generic MM and > enable platforms to accommodate it thereafter. > > 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: Ingo Molnar > 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 > > Tested-by: Christophe Leroy #PPC32 > Suggested-by: Catalin Marinas > Signed-off-by: Andrew Morton > Signed-off-by: Christophe Leroy > Signed-off-by: Anshuman Khandual > --- > > This adds a test validation for architecture exported page table helpers. > Patch adds basic transformation tests at various levels of the page table. > > This test was originally suggested by Catalin during arm64 THP migration > RFC discussion earlier. Going forward it can include more specific tests > with respect to various generic MM functions like THP, HugeTLB etc and > platform specific tests. > > https://lore.kernel.org/linux-mm/20190628102003.GA56463@arrakis.emea.arm.com/ > > Needs to be applied on linux-next (next-20191025). > > Changes in V8: > > - Enabled ARCH_HAS_DEBUG_VM_PGTABLE on PPC32 platform per Christophe > - Updated feature documentation as DEBUG_VM_PGTABLE is now enabled on PPC32 platform > - Moved ARCH_HAS_DEBUG_VM_PGTABLE earlier to indent it with DEBUG_VM per Christophe > - Added an information message in debug_vm_pgtable() per Christophe > - Dropped random_vaddr boundary condition checks per Christophe and Qian > - Replaced virt_addr_valid() check with pfn_valid() check in debug_vm_pgtable() Hello Andrew, Just wondering if this version looks okay or is there anything else which still needs to be accommodated here first, before this test can be considered for merging ? Thank you. - Anshuman