Re: [PATCH] powerpc: wire up memtest

2018-09-28 Thread Michael Ellerman
Christophe LEROY  writes:
> Le 28/09/2018 à 05:41, Michael Ellerman a écrit :
>> Christophe Leroy  writes:
>>> 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 
>>> ---
>>>   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 
>>>   #include 
>>>   #include 
>>> +#include 
>>>   #include 
>>>   #include 
>>>   #include 
>>> @@ -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


Re: [PATCH] powerpc: wire up memtest

2018-09-28 Thread Christophe LEROY




Le 28/09/2018 à 05:41, Michael Ellerman a écrit :

Christophe Leroy  writes:

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 
---
  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 
  #include 
  #include 
+#include 
  #include 
  #include 
  #include 
@@ -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
   0x01450580 - 0x01450800 pattern 4c494e5558726c7a
   0x01450c00 - 0x0360 pattern 4c494e5558726c7a
   0x047c - 0x2fff pattern 4c494e5558726c7a
   0x3000 - 0x3ff24000 pattern 4c494e5558726c7a
   0x3fff4000 - 0x3fff4c00 pattern 4c494e5558726c7a
   0x3fff5000 - 0x3fff5300 pattern 4c494e5558726c7a
   0x3fff5c00 - 0x3fff5f00 pattern 4c494e5558726c7a
   0x3fff6800 - 0x3fff6b00 pattern 4c494e5558726c7a
   0x3fff7400 - 0x3fff7700 pattern 4c494e5558726c7a
   0x3fff8000 - 0x3fff8300 pattern 4c494e5558726c7a
   0x3fff8c00 - 0x3fff8f00 pattern 4c494e5558726c7a
   0x3fff9800 - 0x3fff9b00 pattern 4c494e5558726c7a
   0x3fffa400 - 0x3fffa700 pattern 4c494e5558726c7a
   0x3fffb000 - 0x3fffb300 pattern 4c494e5558726c7a
   0x3fffbc00 - 0x3fffbf00 pattern 4c494e5558726c7a
   0x3fffc800 - 0x3fffcb00 pattern 4c494e5558726c7a
   0x3fffd400 - 0x3fffd700 pattern 4c494e5558726c7a
   0x3fffe000 - 0x3fffe100 pattern 4c494e5558726c7a
   0x4000 - 0xffc1 pattern 4c494e5558726c7a
   0xfffa - 0xfffa5b00 pattern 4c494e5558726c7a
   0x0001 - 0x0001ffbe pattern 4c494e5558726c7a
   0x0001fff6 - 0x0001fff61b00 pattern 4c494e5558726c7a
   0x0001fffec000 - 0x0001fffec4b8 pattern 4c494e5558726c7a
   0x0001fffec524 - 0x0001fffec528 pattern 4c494e5558726c7a


cheers



Re: [PATCH] powerpc: wire up memtest

2018-09-27 Thread Michael Ellerman
Christophe Leroy  writes:
> 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 
> ---
>  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 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -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
  0x01450580 - 0x01450800 pattern 4c494e5558726c7a
  0x01450c00 - 0x0360 pattern 4c494e5558726c7a
  0x047c - 0x2fff pattern 4c494e5558726c7a
  0x3000 - 0x3ff24000 pattern 4c494e5558726c7a
  0x3fff4000 - 0x3fff4c00 pattern 4c494e5558726c7a
  0x3fff5000 - 0x3fff5300 pattern 4c494e5558726c7a
  0x3fff5c00 - 0x3fff5f00 pattern 4c494e5558726c7a
  0x3fff6800 - 0x3fff6b00 pattern 4c494e5558726c7a
  0x3fff7400 - 0x3fff7700 pattern 4c494e5558726c7a
  0x3fff8000 - 0x3fff8300 pattern 4c494e5558726c7a
  0x3fff8c00 - 0x3fff8f00 pattern 4c494e5558726c7a
  0x3fff9800 - 0x3fff9b00 pattern 4c494e5558726c7a
  0x3fffa400 - 0x3fffa700 pattern 4c494e5558726c7a
  0x3fffb000 - 0x3fffb300 pattern 4c494e5558726c7a
  0x3fffbc00 - 0x3fffbf00 pattern 4c494e5558726c7a
  0x3fffc800 - 0x3fffcb00 pattern 4c494e5558726c7a
  0x3fffd400 - 0x3fffd700 pattern 4c494e5558726c7a
  0x3fffe000 - 0x3fffe100 pattern 4c494e5558726c7a
  0x4000 - 0xffc1 pattern 4c494e5558726c7a
  0xfffa - 0xfffa5b00 pattern 4c494e5558726c7a
  0x0001 - 0x0001ffbe pattern 4c494e5558726c7a
  0x0001fff6 - 0x0001fff61b00 pattern 4c494e5558726c7a
  0x0001fffec000 - 0x0001fffec4b8 pattern 4c494e5558726c7a
  0x0001fffec524 - 0x0001fffec528 pattern 4c494e5558726c7a


cheers


[PATCH] powerpc: wire up memtest

2018-08-27 Thread Christophe Leroy
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 
---
 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 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -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