linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mm/debug: Add tests for architecture exported page table helpers
@ 2019-07-25  6:55 Anshuman Khandual
  2019-07-25  6:55 ` [RFC] mm/pgtable/debug: Add test validating architecture " Anshuman Khandual
  0 siblings, 1 reply; 16+ messages in thread
From: Anshuman Khandual @ 2019-07-25  6:55 UTC (permalink / raw)
  To: linux-mm
  Cc: Anshuman Khandual, Andrew Morton, Michal Hocko, Catalin Marinas,
	Mark Rutland, Mark Brown, Steven Price, Ard Biesheuvel,
	Masahiro Yamada, Kees Cook, Tetsuo Handa, Matthew Wilcox,
	Sri Krishna chowdary, Dave Hansen, linux-arm-kernel, x86,
	linux-kernel

This series adds a test validation for architecture exported page table
helpers. Patch in the series add basic transformation tests at various
level 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/

Issues:

Does not build on arm64 as a module and fails with following errors. This
is primarily caused by set_pgd() called from pgd_clear() and pgd_populate().

ERROR: "set_swapper_pgd" [lib/test_arch_pgtable.ko] undefined!
ERROR: "swapper_pg_dir" [lib/test_arch_pgtable.ko] undefined!

These symbols need to be visible for driver usage or will have to disable
loadable module option for this test on arm64 platform.

Testing:

Build and boot tested on arm64 and x86 platforms. While arm64 clears all
these tests, following errors were reported on x86.

1. WARN_ON(pud_bad(pud)) in pud_populate_tests()
2. WARN_ON(p4d_bad(p4d)) in p4d_populate_tests()

I would really appreciate if folks can help validate this test in other
platforms and report back problems if any. Suggestions, comments and
inputs welcome. Thank you.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mark Brown <Mark.Brown@arm.com>
Cc: Steven Price <Steven.Price@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Sri Krishna chowdary <schowdary@nvidia.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: x86@kernel.org
Cc: linux-kernel@vger.kernel.org

Anshuman Khandual (1):
  mm/pgtable/debug: Add test validating architecture page table helpers

 lib/Kconfig.debug       |  14 +++
 lib/Makefile            |   1 +
 lib/test_arch_pgtable.c | 290 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 305 insertions(+)
 create mode 100644 lib/test_arch_pgtable.c

-- 
2.7.4


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-08-05  4:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-25  6:55 [RFC] mm/debug: Add tests for architecture exported page table helpers Anshuman Khandual
2019-07-25  6:55 ` [RFC] mm/pgtable/debug: Add test validating architecture " Anshuman Khandual
2019-07-25 14:39   ` Matthew Wilcox
2019-07-25 21:38     ` Russell King - ARM Linux admin
2019-07-25 21:42       ` Matthew Wilcox
2019-07-25 21:58         ` Russell King - ARM Linux admin
2019-07-25 22:56           ` Matthew Wilcox
2019-07-26  4:47     ` Anshuman Khandual
2019-07-26 19:54       ` Matthew Wilcox
2019-07-29  8:32         ` Anshuman Khandual
2019-07-30 17:03           ` Matthew Wilcox
2019-08-05  4:35             ` Anshuman Khandual
2019-07-25 17:07   ` Catalin Marinas
2019-07-26  4:28     ` Anshuman Khandual
2019-07-25 21:54   ` Russell King - ARM Linux admin
2019-07-26  5:10     ` Anshuman Khandual

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).