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 <a...@linux-foundation.org>
> Cc: Vlastimil Babka <vba...@suse.cz>
> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
> Cc: Thomas Gleixner <t...@linutronix.de>
> Cc: Mike Rapoport <r...@linux.vnet.ibm.com>
> Cc: Jason Gunthorpe <j...@ziepe.ca>
> Cc: Dan Williams <dan.j.willi...@intel.com>
> Cc: Peter Zijlstra <pet...@infradead.org>
> Cc: Michal Hocko <mho...@kernel.org>
> Cc: Mark Rutland <mark.rutl...@arm.com>
> Cc: Mark Brown <broo...@kernel.org>
> Cc: Steven Price <steven.pr...@arm.com>
> Cc: Ard Biesheuvel <ard.biesheu...@linaro.org>
> Cc: Masahiro Yamada <yamada.masah...@socionext.com>
> Cc: Kees Cook <keesc...@chromium.org>
> Cc: Tetsuo Handa <penguin-ker...@i-love.sakura.ne.jp>
> Cc: Matthew Wilcox <wi...@infradead.org>
> Cc: Sri Krishna chowdary <schowd...@nvidia.com>
> Cc: Dave Hansen <dave.han...@intel.com>
> Cc: Russell King - ARM Linux <li...@armlinux.org.uk>
> Cc: Michael Ellerman <m...@ellerman.id.au>
> Cc: Paul Mackerras <pau...@samba.org>
> Cc: Martin Schwidefsky <schwidef...@de.ibm.com>
> Cc: Heiko Carstens <heiko.carst...@de.ibm.com>
> Cc: "David S. Miller" <da...@davemloft.net>
> Cc: Vineet Gupta <vgu...@synopsys.com>
> Cc: James Hogan <jho...@kernel.org>
> Cc: Paul Burton <paul.bur...@mips.com>
> Cc: Ralf Baechle <r...@linux-mips.org>
> Cc: Kirill A. Shutemov <kir...@shutemov.name>
> Cc: Gerald Schaefer <gerald.schae...@de.ibm.com>
> Cc: Christophe Leroy <christophe.le...@c-s.fr>
> Cc: Ingo Molnar <mi...@kernel.org>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-m...@vger.kernel.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-i...@vger.kernel.org
> Cc: linuxppc-...@lists.ozlabs.org
> Cc: linux-s...@vger.kernel.org
> Cc: linux...@vger.kernel.org
> Cc: sparcli...@vger.kernel.org
> Cc: x...@kernel.org
> Cc: linux-ker...@vger.kernel.org
>
> Tested-by: Christophe Leroy <christophe.le...@c-s.fr> #PPC32
> Suggested-by: Catalin Marinas <catalin.mari...@arm.com>
> Signed-off-by: Andrew Morton <a...@linux-foundation.org>
> Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr>
> Signed-off-by: Anshuman Khandual <anshuman.khand...@arm.com>
> ---
>
> 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.ga56...@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
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc