Skip to contentSkip to conversation

x86: seperate memtest from init_64.c

PATCH New Yinghai Lu 3 participants 4 messages Jul 15, 2008 – Jul 18, 2008

Subsystems (3)
lore
Share & tools
lore
author
#1 lore raw

PATCH 1/1 x86: make memtest support 32bit

In reply to Yinghai Lu

only support max_low_pfn below...

---
 Documentation/kernel-parameters.txt |    2 +-
 arch/x86/Kconfig                    |    1 -
 arch/x86/mm/init_32.c               |    3 +++
 3 files changed, 4 insertions(+), 2 deletions(-)
Documentation/kernel-parameters.txt +1 -1
Index: linux-2.6/Documentation/kernel-parameters.txt
===================================================================
@@ -1200,7 +1200,7 @@ and is between 256 and 4096 characters.
 			         or
 			         memmap=0x10000$0x18690000
 
-	memtest=	[KNL,X86_64] Enable memtest
+	memtest=	[KNL,X86] Enable memtest
 			Format: <integer>
 			range: 0,4 : pattern number
 			default : 0 <disable>
arch/x86/mm/init_32.c +3 -0
Index: linux-2.6/arch/x86/mm/init_32.c
===================================================================
@@ -844,6 +844,9 @@ unsigned long __init_refok init_memory_m
 		reserve_early(table_start << PAGE_SHIFT,
 				 table_end << PAGE_SHIFT, "PGTABLE");
 
+	if (!after_init_bootmem)
+		early_memtest(start, end);
+
 	return end >> PAGE_SHIFT;
 }
 
arch/x86/Kconfig +0 -1
Index: linux-2.6/arch/x86/Kconfig
===================================================================
@@ -448,7 +448,6 @@ config PARAVIRT_DEBUG
 
 config MEMTEST
 	bool "Memtest"
-	depends on X86_64
 	default y
 	help
 	  This option adds a kernel parameter 'memtest', which allows memtest

Yinghai Lu

author
#0 lore raw

PATCH 1/1 x86: seperate memtest from init_64.c

---
 arch/x86/mm/Makefile   |    1 
 arch/x86/mm/init_64.c  |  112 --------------------------------------------
 arch/x86/mm/memtest.c  |  123 +++++++++++++++++++++++++++++++++++++++++++++++++
 include/asm-x86/e820.h |    8 +++
 4 files changed, 132 insertions(+), 112 deletions(-)
arch/x86/mm/Makefile +1 -0
Index: linux-2.6/arch/x86/mm/Makefile
===================================================================
@@ -23,3 +23,4 @@ obj-$(CONFIG_K8_NUMA)		+= k8topology_64.
 endif
 obj-$(CONFIG_ACPI_NUMA)		+= srat_$(BITS).o
 
+obj-$(CONFIG_MEMTEST)		+= memtest.o
arch/x86/mm/init_64.c +0 -112

118 lines not on this page · raw message

arch/x86/mm/memtest.c new file +123 -0

123 lines not on this page · raw message

include/asm-x86/e820.h +8 -0
Index: linux-2.6/include/asm-x86/e820.h
===================================================================
@@ -89,6 +89,14 @@ static inline void e820_mark_nosave_regi
 }
 #endif
 
+#ifdef CONFIG_MEMTEST
+extern void early_memtest(unsigned long start, unsigned long end);
+#else
+static inline void early_memtest(unsigned long start, unsigned long end)
+{
+}
+#endif
+
 extern unsigned long end_user_pfn;
 
 extern u64 find_e820_area(u64 start, u64 end, u64 size, u64 align);
#2 lore raw

Re: [PATCH] x86: make memtest support 32bit

In reply to Yinghai Lu
Quoted 1 line · Yinghai Lu

only support max_low_pfn below...

.... either add a fixmap or document that 32bit memtest will only test a small fraction of the available memory on systems with >1GB. In fact with this restriction it seems rather useless.

-Andi

#3 lore raw

Re: [PATCH] x86: make memtest support 32bit

In reply to Yinghai Lu
Quoted 1 line · Yinghai Lu

only support max_low_pfn below...

applied to tip/x86/memtest - thanks Yinghai.

Ingo