[PATCH 17/24] alpha: select ARCH_USE_MEMTEST
From: Matt Turner
Date: Tue Sep 01 2026 - 12:56:39 EST
Wire up the generic early memtest from arch_mm_preinit(), which runs
after parse_early_param() has picked up the memtest= command line option
and before memblock_free_all() hands the memory to the buddy allocator.
paging_init() would be the natural place, but Alpha calls it from
setup_arch(), before the option is parsed, so the test would never run.
The test range starts at the first DRAM address rather than physical zero
because low memory on Alpha is owned by the console and PALcode.
Tested under QEMU with memtest=4: all four patterns pass over the free
memblock ranges, with no bad memory reserved.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Matt Turner <mattst88@xxxxxxxxx>
---
arch/alpha/Kconfig | 1 +
arch/alpha/mm/init.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git ./arch/alpha/Kconfig ./arch/alpha/Kconfig
index 352615956b1e..c4b4a9b8d770 100644
--- ./arch/alpha/Kconfig
+++ ./arch/alpha/Kconfig
@@ -20,6 +20,7 @@ config ALPHA
select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
select ARCH_SUPPORTS_PAGE_TABLE_CHECK
select ARCH_USE_CMPXCHG_LOCKREF
+ select ARCH_USE_MEMTEST
select FORCE_PCI
select PCI_DOMAINS if PCI
select PCI_SYSCALL if PCI
diff --git ./arch/alpha/mm/init.c ./arch/alpha/mm/init.c
index f4d65a60c869..6c28947d6e2d 100644
--- ./arch/alpha/mm/init.c
+++ ./arch/alpha/mm/init.c
@@ -226,6 +226,11 @@ void __init paging_init(void)
memset(absolute_pointer(ZERO_PGE), 0, PAGE_SIZE);
}
+void __init arch_mm_preinit(void)
+{
+ early_memtest(memblock_start_of_DRAM(), PFN_PHYS(max_low_pfn));
+}
+
#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_SRM)
void
srm_paging_stop (void)
--
2.54.0