aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Murzin <vladimir.murzin@arm.com>2015-04-14 18:48:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-14 19:49:06 -0400
commit4a20799d11f64e6b8725cacc7619b1ae1dbf9acd (patch)
tree7753b51a235867c625ae7a8a8ab040290b43ff37
parent02057967b5d3b77ed47f06ee8fe98e2687fdf18b (diff)
mm: move memtest under mm
Memtest is a simple feature which fills the memory with a given set of patterns and validates memory contents, if bad memory regions is detected it reserves them via memblock API. Since memblock API is widely used by other architectures this feature can be enabled outside of x86 world. This patch set promotes memtest to live under generic mm umbrella and enables memtest feature for arm/arm64. It was reported that this patch set was useful for tracking down an issue with some errant DMA on an arm64 platform. This patch (of 6): There is nothing platform dependent in the core memtest code, so other platforms might benefit from this feature too. [linux@roeck-us.net: MEMTEST depends on MEMBLOCK] Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com> Acked-by: Will Deacon <will.deacon@arm.com> Tested-by: Mark Rutland <mark.rutland@arm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/x86/Kconfig11
-rw-r--r--arch/x86/include/asm/e820.h8
-rw-r--r--arch/x86/mm/Makefile2
-rw-r--r--include/linux/memblock.h8
-rw-r--r--lib/Kconfig.debug12
-rw-r--r--mm/Makefile1
-rw-r--r--mm/memtest.c (renamed from arch/x86/mm/memtest.c)0
7 files changed, 21 insertions, 21 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 1f7f185934a5..d43e7e1c784b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -721,17 +721,6 @@ endif #HYPERVISOR_GUEST
721config NO_BOOTMEM 721config NO_BOOTMEM
722 def_bool y 722 def_bool y
723 723
724config MEMTEST
725 bool "Memtest"
726 ---help---
727 This option adds a kernel parameter 'memtest', which allows memtest
728 to be set.
729 memtest=0, mean disabled; -- default
730 memtest=1, mean do 1 test pattern;
731 ...
732 memtest=4, mean do 4 test patterns.
733 If you are unsure how to answer this question, answer N.
734
735source "arch/x86/Kconfig.cpu" 724source "arch/x86/Kconfig.cpu"
736 725
737config HPET_TIMER 726config HPET_TIMER
diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
index 779c2efe2e97..3ab0537872fb 100644
--- a/arch/x86/include/asm/e820.h
+++ b/arch/x86/include/asm/e820.h
@@ -40,14 +40,6 @@ static inline void e820_mark_nosave_regions(unsigned long limit_pfn)
40} 40}
41#endif 41#endif
42 42
43#ifdef CONFIG_MEMTEST
44extern void early_memtest(unsigned long start, unsigned long end);
45#else
46static inline void early_memtest(unsigned long start, unsigned long end)
47{
48}
49#endif
50
51extern unsigned long e820_end_of_ram_pfn(void); 43extern unsigned long e820_end_of_ram_pfn(void);
52extern unsigned long e820_end_of_low_ram_pfn(void); 44extern unsigned long e820_end_of_low_ram_pfn(void);
53extern u64 early_reserve_e820(u64 sizet, u64 align); 45extern u64 early_reserve_e820(u64 sizet, u64 align);
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index c4cc74006c61..a482d105172b 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
@@ -32,6 +32,4 @@ obj-$(CONFIG_AMD_NUMA) += amdtopology.o
32obj-$(CONFIG_ACPI_NUMA) += srat.o 32obj-$(CONFIG_ACPI_NUMA) += srat.o
33obj-$(CONFIG_NUMA_EMU) += numa_emulation.o 33obj-$(CONFIG_NUMA_EMU) += numa_emulation.o
34 34
35obj-$(CONFIG_MEMTEST) += memtest.o
36
37obj-$(CONFIG_X86_INTEL_MPX) += mpx.o 35obj-$(CONFIG_X86_INTEL_MPX) += mpx.o
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index e8cc45307f8f..6724cb020f5e 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -365,6 +365,14 @@ static inline unsigned long memblock_region_reserved_end_pfn(const struct memblo
365#define __initdata_memblock 365#define __initdata_memblock
366#endif 366#endif
367 367
368#ifdef CONFIG_MEMTEST
369extern void early_memtest(unsigned long start, unsigned long end);
370#else
371static inline void early_memtest(unsigned long start, unsigned long end)
372{
373}
374#endif
375
368#else 376#else
369static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align) 377static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align)
370{ 378{
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 36b6fa88ce5b..5c7a3183423b 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1745,6 +1745,18 @@ config TEST_UDELAY
1745 1745
1746 If unsure, say N. 1746 If unsure, say N.
1747 1747
1748config MEMTEST
1749 bool "Memtest"
1750 depends on HAVE_MEMBLOCK
1751 ---help---
1752 This option adds a kernel parameter 'memtest', which allows memtest
1753 to be set.
1754 memtest=0, mean disabled; -- default
1755 memtest=1, mean do 1 test pattern;
1756 ...
1757 memtest=4, mean do 4 test patterns.
1758 If you are unsure how to answer this question, answer N.
1759
1748source "samples/Kconfig" 1760source "samples/Kconfig"
1749 1761
1750source "lib/Kconfig.kgdb" 1762source "lib/Kconfig.kgdb"
diff --git a/mm/Makefile b/mm/Makefile
index 668a9bb82be4..98c4eaeabdcb 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -55,6 +55,7 @@ obj-$(CONFIG_KMEMCHECK) += kmemcheck.o
55obj-$(CONFIG_KASAN) += kasan/ 55obj-$(CONFIG_KASAN) += kasan/
56obj-$(CONFIG_FAILSLAB) += failslab.o 56obj-$(CONFIG_FAILSLAB) += failslab.o
57obj-$(CONFIG_MEMORY_HOTPLUG) += memory_hotplug.o 57obj-$(CONFIG_MEMORY_HOTPLUG) += memory_hotplug.o
58obj-$(CONFIG_MEMTEST) += memtest.o
58obj-$(CONFIG_MIGRATION) += migrate.o 59obj-$(CONFIG_MIGRATION) += migrate.o
59obj-$(CONFIG_QUICKLIST) += quicklist.o 60obj-$(CONFIG_QUICKLIST) += quicklist.o
60obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o 61obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o
diff --git a/arch/x86/mm/memtest.c b/mm/memtest.c
index 1e9da795767a..1e9da795767a 100644
--- a/arch/x86/mm/memtest.c
+++ b/mm/memtest.c