path: root/lib
diff options
authorAnshuman Khandual <>2021-04-29 22:55:15 -0700
committerLinus Torvalds <>2021-04-30 11:20:36 -0700
commitdce44566192ec0b38597fdfd435013c2d54653ff (patch)
tree05ff6c565da78e8ebe8d333b9b80793c322b02e2 /lib
parentf58bd538e6a2deb2bcdfe527d9ed45643348a4e6 (diff)
mm/memtest: add ARCH_USE_MEMTEST
early_memtest() does not get called from all architectures. Hence enabling CONFIG_MEMTEST and providing a valid memtest=[1..N] kernel command line option might not trigger the memory pattern tests as would be expected in normal circumstances. This situation is misleading. The change here prevents the above mentioned problem after introducing a new config option ARCH_USE_MEMTEST that should be subscribed on platforms that call early_memtest(), in order to enable the config CONFIG_MEMTEST. Conversely CONFIG_MEMTEST cannot be enabled on platforms where it would not be tested anyway. Link: Signed-off-by: Anshuman Khandual <> Acked-by: Catalin Marinas <> (arm64) Reviewed-by: Max Filippov <> Cc: Russell King <> Cc: Will Deacon <> Cc: Thomas Bogendoerfer <> Cc: Michael Ellerman <> Cc: Benjamin Herrenschmidt <> Cc: Paul Mackerras <> Cc: Thomas Gleixner <> Cc: Ingo Molnar <> Cc: Chris Zankel <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'lib')
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index b38bbb5bb00e..678c13967580 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2573,11 +2573,18 @@ config TEST_FPU
+ bool
+ help
+ An architecture should select this when it uses early_memtest()
+ during boot process.
config MEMTEST
bool "Memtest"
+ depends on ARCH_USE_MEMTEST
This option adds a kernel parameter 'memtest', which allows memtest
- to be set.
+ to be set and executed.
memtest=0, mean disabled; -- default
memtest=1, mean do 1 test pattern;