[PATCH] powerpc: wire up memtest

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE2870d

4 messages, 2 authors, 2018-09-28 · open the first message on its own page

[PATCH] powerpc: wire up memtest

From: Christophe Leroy <hidden>
Date: 2018-08-27 09:02:12

Add call to early_memtest() so that kernel compiled with
CONFIG_MEMTEST really perform memtest at startup when requested
via 'memtest' boot parameter.

Signed-off-by: Christophe Leroy <redacted>
---
 arch/powerpc/kernel/setup-common.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 93fa0c99681e..904b728eb20d 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -33,6 +33,7 @@
 #include <linux/serial_8250.h>
 #include <linux/percpu.h>
 #include <linux/memblock.h>
+#include <linux/bootmem.h>
 #include <linux/of_platform.h>
 #include <linux/hugetlb.h>
 #include <asm/debugfs.h>
@@ -917,6 +918,8 @@ void __init setup_arch(char **cmdline_p)
 	/* Parse memory topology */
 	mem_topology_setup();
 
+	early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT);
+
 	/*
 	 * Release secondary cpus out of their spinloops at 0x60 now that
 	 * we can map physical -> logical CPU ids.
-- 
2.13.3

Re: [PATCH] powerpc: wire up memtest

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2018-09-28 03:41:21

Christophe Leroy [off-list ref] writes:
quoted hunk
Add call to early_memtest() so that kernel compiled with
CONFIG_MEMTEST really perform memtest at startup when requested
via 'memtest' boot parameter.

Signed-off-by: Christophe Leroy <redacted>
---
 arch/powerpc/kernel/setup-common.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 93fa0c99681e..904b728eb20d 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -33,6 +33,7 @@
 #include <linux/serial_8250.h>
 #include <linux/percpu.h>
 #include <linux/memblock.h>
+#include <linux/bootmem.h>
 #include <linux/of_platform.h>
 #include <linux/hugetlb.h>
 #include <asm/debugfs.h>
@@ -917,6 +918,8 @@ void __init setup_arch(char **cmdline_p)
 	/* Parse memory topology */
 	mem_topology_setup();
 
+	early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT);
On a ppc64le VM this boils down to early_memtest(0, 0) for me.

I think it's too early, we don't set up max_low_pfn until
initmem_init().

If I move it after initmem_init() then it does something more useful:

early_memtest: # of tests: 17
  0x0000000001450580 - 0x0000000001450800 pattern 4c494e5558726c7a
  0x0000000001450c00 - 0x0000000003600000 pattern 4c494e5558726c7a
  0x00000000047c0000 - 0x000000002fff0000 pattern 4c494e5558726c7a
  0x0000000030000000 - 0x000000003ff24000 pattern 4c494e5558726c7a
  0x000000003fff4000 - 0x000000003fff4c00 pattern 4c494e5558726c7a
  0x000000003fff5000 - 0x000000003fff5300 pattern 4c494e5558726c7a
  0x000000003fff5c00 - 0x000000003fff5f00 pattern 4c494e5558726c7a
  0x000000003fff6800 - 0x000000003fff6b00 pattern 4c494e5558726c7a
  0x000000003fff7400 - 0x000000003fff7700 pattern 4c494e5558726c7a
  0x000000003fff8000 - 0x000000003fff8300 pattern 4c494e5558726c7a
  0x000000003fff8c00 - 0x000000003fff8f00 pattern 4c494e5558726c7a
  0x000000003fff9800 - 0x000000003fff9b00 pattern 4c494e5558726c7a
  0x000000003fffa400 - 0x000000003fffa700 pattern 4c494e5558726c7a
  0x000000003fffb000 - 0x000000003fffb300 pattern 4c494e5558726c7a
  0x000000003fffbc00 - 0x000000003fffbf00 pattern 4c494e5558726c7a
  0x000000003fffc800 - 0x000000003fffcb00 pattern 4c494e5558726c7a
  0x000000003fffd400 - 0x000000003fffd700 pattern 4c494e5558726c7a
  0x000000003fffe000 - 0x000000003fffe100 pattern 4c494e5558726c7a
  0x0000000040000000 - 0x00000000ffc10000 pattern 4c494e5558726c7a
  0x00000000fffa0000 - 0x00000000fffa5b00 pattern 4c494e5558726c7a
  0x0000000100000000 - 0x00000001ffbe0000 pattern 4c494e5558726c7a
  0x00000001fff60000 - 0x00000001fff61b00 pattern 4c494e5558726c7a
  0x00000001fffec000 - 0x00000001fffec4b8 pattern 4c494e5558726c7a
  0x00000001fffec524 - 0x00000001fffec528 pattern 4c494e5558726c7a


cheers

Re: [PATCH] powerpc: wire up memtest

From: Christophe LEROY <hidden>
Date: 2018-09-28 08:28:58


Le 28/09/2018 à 05:41, Michael Ellerman a écrit :
Christophe Leroy [off-list ref] writes:
quoted
Add call to early_memtest() so that kernel compiled with
CONFIG_MEMTEST really perform memtest at startup when requested
via 'memtest' boot parameter.

Signed-off-by: Christophe Leroy <redacted>
---
  arch/powerpc/kernel/setup-common.c | 3 +++
  1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 93fa0c99681e..904b728eb20d 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -33,6 +33,7 @@
  #include <linux/serial_8250.h>
  #include <linux/percpu.h>
  #include <linux/memblock.h>
+#include <linux/bootmem.h>
  #include <linux/of_platform.h>
  #include <linux/hugetlb.h>
  #include <asm/debugfs.h>
@@ -917,6 +918,8 @@ void __init setup_arch(char **cmdline_p)
  	/* Parse memory topology */
  	mem_topology_setup();
  
+	early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT);
On a ppc64le VM this boils down to early_memtest(0, 0) for me.

I think it's too early, we don't set up max_low_pfn until
initmem_init().

If I move it after initmem_init() then it does something more useful:
Ok. On my 8xx max_low_pfn is set in mem_topology_setup().

Moving the test afte initmem_init() still works on the 8xx so I'll do that.

Thanks for testing.

Christophe
early_memtest: # of tests: 17
   0x0000000001450580 - 0x0000000001450800 pattern 4c494e5558726c7a
   0x0000000001450c00 - 0x0000000003600000 pattern 4c494e5558726c7a
   0x00000000047c0000 - 0x000000002fff0000 pattern 4c494e5558726c7a
   0x0000000030000000 - 0x000000003ff24000 pattern 4c494e5558726c7a
   0x000000003fff4000 - 0x000000003fff4c00 pattern 4c494e5558726c7a
   0x000000003fff5000 - 0x000000003fff5300 pattern 4c494e5558726c7a
   0x000000003fff5c00 - 0x000000003fff5f00 pattern 4c494e5558726c7a
   0x000000003fff6800 - 0x000000003fff6b00 pattern 4c494e5558726c7a
   0x000000003fff7400 - 0x000000003fff7700 pattern 4c494e5558726c7a
   0x000000003fff8000 - 0x000000003fff8300 pattern 4c494e5558726c7a
   0x000000003fff8c00 - 0x000000003fff8f00 pattern 4c494e5558726c7a
   0x000000003fff9800 - 0x000000003fff9b00 pattern 4c494e5558726c7a
   0x000000003fffa400 - 0x000000003fffa700 pattern 4c494e5558726c7a
   0x000000003fffb000 - 0x000000003fffb300 pattern 4c494e5558726c7a
   0x000000003fffbc00 - 0x000000003fffbf00 pattern 4c494e5558726c7a
   0x000000003fffc800 - 0x000000003fffcb00 pattern 4c494e5558726c7a
   0x000000003fffd400 - 0x000000003fffd700 pattern 4c494e5558726c7a
   0x000000003fffe000 - 0x000000003fffe100 pattern 4c494e5558726c7a
   0x0000000040000000 - 0x00000000ffc10000 pattern 4c494e5558726c7a
   0x00000000fffa0000 - 0x00000000fffa5b00 pattern 4c494e5558726c7a
   0x0000000100000000 - 0x00000001ffbe0000 pattern 4c494e5558726c7a
   0x00000001fff60000 - 0x00000001fff61b00 pattern 4c494e5558726c7a
   0x00000001fffec000 - 0x00000001fffec4b8 pattern 4c494e5558726c7a
   0x00000001fffec524 - 0x00000001fffec528 pattern 4c494e5558726c7a


cheers

Re: [PATCH] powerpc: wire up memtest

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2018-09-28 12:44:13

Christophe LEROY [off-list ref] writes:
Le 28/09/2018 à 05:41, Michael Ellerman a écrit :
quoted
Christophe Leroy [off-list ref] writes:
quoted
Add call to early_memtest() so that kernel compiled with
CONFIG_MEMTEST really perform memtest at startup when requested
via 'memtest' boot parameter.

Signed-off-by: Christophe Leroy <redacted>
---
  arch/powerpc/kernel/setup-common.c | 3 +++
  1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 93fa0c99681e..904b728eb20d 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -33,6 +33,7 @@
  #include <linux/serial_8250.h>
  #include <linux/percpu.h>
  #include <linux/memblock.h>
+#include <linux/bootmem.h>
  #include <linux/of_platform.h>
  #include <linux/hugetlb.h>
  #include <asm/debugfs.h>
@@ -917,6 +918,8 @@ void __init setup_arch(char **cmdline_p)
  	/* Parse memory topology */
  	mem_topology_setup();
  
+	early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT);
On a ppc64le VM this boils down to early_memtest(0, 0) for me.

I think it's too early, we don't set up max_low_pfn until
initmem_init().

If I move it after initmem_init() then it does something more useful:
Ok. On my 8xx max_low_pfn is set in mem_topology_setup().

Moving the test afte initmem_init() still works on the 8xx so I'll do that.
Great, thanks.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help