Re: [PASEMI] Nemo board doesn't boot anymore after the commit "powerpc/book3s64/pkeys: Simplify pkey disable branch"

2020-08-10 Thread Christian Zigotzky

Am 10.08.20 um 10:58 schrieb Aneesh Kumar K.V:

On 8/10/20 2:15 PM, Christian Zigotzky wrote:

Hello Aneesh,

I tested the new kernel today and unfortunately it doesn't run very 
well.


I have only one core (1 physical processor; 1 core; 2 threads) 
instead of two cores (1 physical processor; 2 cores; 2 threads) so 
the system is slower.


Boot log: http://www.xenosoft.de/dmesg_nemo_board_kernel_5.9.txt

Could you please check the updates?



modified   arch/powerpc/mm/book3s64/hash_utils.c
@@ -1116,7 +1116,8 @@ void hash__early_init_mmu_secondary(void)
 tlbiel_all();

 #ifdef CONFIG_PPC_MEM_KEYS
-    mtspr(SPRN_UAMOR, default_uamor);
+    if (mmu_has_feature(MMU_FTR_PKEY))
+    mtspr(SPRN_UAMOR, default_uamor);
 #endif
 }
 #endif /* CONFIG_SMP */



-aneesh

Hello Aneesh,

Your modifications work! I have 2 cores again and I can see the boot 
messages.


Thanks a lot!

Cheers,
Christian


Re: [PASEMI] Nemo board doesn't boot anymore after the commit "powerpc/book3s64/pkeys: Simplify pkey disable branch"

2020-08-10 Thread Aneesh Kumar K.V

On 8/10/20 2:15 PM, Christian Zigotzky wrote:

Hello Aneesh,

I tested the new kernel today and unfortunately it doesn't run very well.

I have only one core (1 physical processor; 1 core; 2 threads) instead 
of two cores (1 physical processor; 2 cores; 2 threads) so the system is 
slower.


Boot log: http://www.xenosoft.de/dmesg_nemo_board_kernel_5.9.txt

Could you please check the updates?



modified   arch/powerpc/mm/book3s64/hash_utils.c
@@ -1116,7 +1116,8 @@ void hash__early_init_mmu_secondary(void)
tlbiel_all();

 #ifdef CONFIG_PPC_MEM_KEYS
-   mtspr(SPRN_UAMOR, default_uamor);
+   if (mmu_has_feature(MMU_FTR_PKEY))
+   mtspr(SPRN_UAMOR, default_uamor);
 #endif
 }
 #endif /* CONFIG_SMP */



-aneesh


Re: [PASEMI] Nemo board doesn't boot anymore after the commit "powerpc/book3s64/pkeys: Simplify pkey disable branch"

2020-08-10 Thread Christian Zigotzky

Hello Aneesh,

I tested the new kernel today and unfortunately it doesn't run very well.

I have only one core (1 physical processor; 1 core; 2 threads) instead 
of two cores (1 physical processor; 2 cores; 2 threads) so the system is 
slower.


Boot log: http://www.xenosoft.de/dmesg_nemo_board_kernel_5.9.txt

Could you please check the updates?

Thanks,
Christian


On 10 August 2020 at 09:56 am, Christian Zigotzky wrote:

Hello Aneesh,

The Nemo board boots with your patch but unfortunately I don't see any 
boot messages anymore.


Please find attached the kernel config.

Thanks,
Christian


On 09 August 2020 at 5:49 pm, Christian Zigotzky wrote:

Hello Aneesh,

Many thanks for your fast response and thanks a lot for your patch!
I will patch and compile a new git kernel tomorrow. I am looking 
forward to the result.


Have a nice day!

Cheers,
Christian

On 9. Aug 2020, at 17:11, Aneesh Kumar K.V 
 wrote:


"Aneesh Kumar K.V"  writes:


On 8/9/20 8:04 PM, Aneesh Kumar K.V wrote:
On 8/9/20 7:42 PM, Christian Zigotzky wrote:

Hello,

The Nemo board (A-EON AmigaOne X1000) [1] doesn't start with the
latest Git kernel anymore after the commit "powerpc/book3s64/pkeys:
Simplify pkey disable branch" [2].

I bisected today [3].

Result: powerpc/book3s64/pkeys: Simplify pkey disable branch
(a4678d4b477c3d2901f101986ca01406f3b7eaea) [2] is the first bad 
commit.


Unfortunately I wasn't able to revert the first bad commit. The 
first
bad commit depends on many other commits, which unfortunately I 
don't
know. I tried to remove the modifications of the files from the 
first
bad commit but without any success. There are just too many 
dependencies.


Additionally I reverted the commit "selftests/powerpc: Fix pkey
syscall redefinitions" [4] and compiled a new kernel but without any
success.

Could you please check the first bad commit?

Thanks,
Christian



Can you share a successful boot log of the system so that i can 
double

check the cpu_feature and mmu_feature reported ? I am looking for
details similar to below.

[    0.00] cpu_features  = 0x0001c07f8f5f91a7
[    0.00]   possible    = 0x0001fbffcf5fb1a7
[    0.00]   always  = 0x0003800081a1
[    0.00] cpu_user_features = 0xdc0065c2 0xefe0
[    0.00] mmu_features  = 0x7c006001
[    0.00] firmware_features = 0x001fc45bfc57
[    0.00] vmalloc start = 0xc008
[    0.00] IO start  = 0xc00a
[    0.00] vmemmap start = 0xc00c


IIUC this is P5+? (ISA 2.04). On that pkey should be marked 
disabled via


static int scan_pkey_feature(void)
{
 int ret;
 int pkeys_total = 0;

 

 /*
  * Only P7 and above supports SPRN_AMR update with MSR[PR] = 1
  */
 if (!early_cpu_has_feature(CPU_FTR_ARCH_206))
 return 0;


}

Can you boot with CONFIG_PPC_MEM_KEYS=n ?


Can you try this change on top of master?


modified   arch/powerpc/mm/book3s64/pkeys.c
@@ -215,10 +215,6 @@ void __init pkey_early_init_devtree(void)

  pr_info("Enabling pkeys with max key count %d\n", num_pkey);
  out:
-    /*
- * Setup uamor on boot cpu
- */
-    mtspr(SPRN_UAMOR, default_uamor);

  return;
  }


Full patch with better description.

commit 919a177bcdaf1eaeaeecc0d0f50a688629d7b5df
Author: Aneesh Kumar K.V 
Date:   Sun Aug 9 20:37:38 2020 +0530

    powerpc/pkeys: Fix boot failures with Nemo board (A-EON AmigaOne 
X1000)


    On p6 and before we should avoid updating UAMOR SPRN. This resulted
    in boot failure on Nemo board.

    Fixes: 269e829f48a0 ("powerpc/book3s64/pkey: Disable pkey on 
POWER6 and before")

    Reported-by: Christian Zigotzky 
    Signed-off-by: Aneesh Kumar K.V 

diff --git a/arch/powerpc/mm/book3s64/pkeys.c 
b/arch/powerpc/mm/book3s64/pkeys.c

index 69a6b87f2bb4..b1d091a97611 100644
--- a/arch/powerpc/mm/book3s64/pkeys.c
+++ b/arch/powerpc/mm/book3s64/pkeys.c
@@ -73,12 +73,6 @@ static int scan_pkey_feature(void)
    if (early_radix_enabled())
    return 0;

-    /*
- * Only P7 and above supports SPRN_AMR update with MSR[PR] = 1
- */
-    if (!early_cpu_has_feature(CPU_FTR_ARCH_206))
-    return 0;
-
    ret = of_scan_flat_dt(dt_scan_storage_keys, _total);
    if (ret == 0) {
    /*
@@ -124,6 +118,12 @@ void __init pkey_early_init_devtree(void)
 __builtin_popcountl(ARCH_VM_PKEY_FLAGS >> VM_PKEY_SHIFT)
    != (sizeof(u64) * BITS_PER_BYTE));

+    /*
+ * Only P7 and above supports SPRN_AMR update with MSR[PR] = 1
+ */
+    if (!early_cpu_has_feature(CPU_FTR_ARCH_206))
+    return;
+
    /* scan the device tree for pkey feature */
    pkeys_total = scan_pkey_feature();
    if (!pkeys_total)






Re: [PASEMI] Nemo board doesn't boot anymore after the commit "powerpc/book3s64/pkeys: Simplify pkey disable branch"

2020-08-09 Thread Aneesh Kumar K.V

On 8/9/20 8:04 PM, Aneesh Kumar K.V wrote:

On 8/9/20 7:42 PM, Christian Zigotzky wrote:

Hello,

The Nemo board (A-EON AmigaOne X1000) [1] doesn't start with the 
latest Git kernel anymore after the commit "powerpc/book3s64/pkeys: 
Simplify pkey disable branch" [2].


I bisected today [3].

Result: powerpc/book3s64/pkeys: Simplify pkey disable branch 
(a4678d4b477c3d2901f101986ca01406f3b7eaea) [2] is the first bad commit.


Unfortunately I wasn't able to revert the first bad commit. The first 
bad commit depends on many other commits, which unfortunately I don't 
know. I tried to remove the modifications of the files from the first 
bad commit but without any success. There are just too many dependencies.


Additionally I reverted the commit "selftests/powerpc: Fix pkey 
syscall redefinitions" [4] and compiled a new kernel but without any 
success.


Could you please check the first bad commit?

Thanks,
Christian




Can you share a successful boot log of the system so that i can double 
check the cpu_feature and mmu_feature reported ? I am looking for 
details similar to below.


[    0.00] cpu_features  = 0x0001c07f8f5f91a7
[    0.00]   possible    = 0x0001fbffcf5fb1a7
[    0.00]   always  = 0x0003800081a1
[    0.00] cpu_user_features = 0xdc0065c2 0xefe0
[    0.00] mmu_features  = 0x7c006001
[    0.00] firmware_features = 0x001fc45bfc57
[    0.00] vmalloc start = 0xc008
[    0.00] IO start  = 0xc00a
[    0.00] vmemmap start = 0xc00c


IIUC this is P5+? (ISA 2.04). On that pkey should be marked disabled via

static int scan_pkey_feature(void)
{
 int ret;
 int pkeys_total = 0;

 

 /*
  * Only P7 and above supports SPRN_AMR update with MSR[PR] = 1
  */
 if (!early_cpu_has_feature(CPU_FTR_ARCH_206))
     return 0;


}

Can you boot with CONFIG_PPC_MEM_KEYS=n ?



Can you try this change on top of master?


modified   arch/powerpc/mm/book3s64/pkeys.c
@@ -215,10 +215,6 @@ void __init pkey_early_init_devtree(void)

pr_info("Enabling pkeys with max key count %d\n", num_pkey);
 out:
-   /*
-* Setup uamor on boot cpu
-*/
-   mtspr(SPRN_UAMOR, default_uamor);

return;
 }

-aneesh


Re: [PASEMI] Nemo board doesn't boot anymore after the commit "powerpc/book3s64/pkeys: Simplify pkey disable branch"

2020-08-09 Thread Aneesh Kumar K.V

On 8/9/20 7:42 PM, Christian Zigotzky wrote:

Hello,

The Nemo board (A-EON AmigaOne X1000) [1] doesn't start with the latest 
Git kernel anymore after the commit "powerpc/book3s64/pkeys: Simplify 
pkey disable branch" [2].


I bisected today [3].

Result: powerpc/book3s64/pkeys: Simplify pkey disable branch 
(a4678d4b477c3d2901f101986ca01406f3b7eaea) [2] is the first bad commit.


Unfortunately I wasn't able to revert the first bad commit. The first 
bad commit depends on many other commits, which unfortunately I don't 
know. I tried to remove the modifications of the files from the first 
bad commit but without any success. There are just too many dependencies.


Additionally I reverted the commit "selftests/powerpc: Fix pkey syscall 
redefinitions" [4] and compiled a new kernel but without any success.


Could you please check the first bad commit?

Thanks,
Christian




Can you share a successful boot log of the system so that i can double 
check the cpu_feature and mmu_feature reported ? I am looking for 
details similar to below.


[0.00] cpu_features  = 0x0001c07f8f5f91a7
[0.00]   possible= 0x0001fbffcf5fb1a7
[0.00]   always  = 0x0003800081a1
[0.00] cpu_user_features = 0xdc0065c2 0xefe0
[0.00] mmu_features  = 0x7c006001
[0.00] firmware_features = 0x001fc45bfc57
[0.00] vmalloc start = 0xc008
[0.00] IO start  = 0xc00a
[0.00] vmemmap start = 0xc00c


IIUC this is P5+? (ISA 2.04). On that pkey should be marked disabled via

static int scan_pkey_feature(void)
{
int ret;
int pkeys_total = 0;



/*
 * Only P7 and above supports SPRN_AMR update with MSR[PR] = 1
 */
if (!early_cpu_has_feature(CPU_FTR_ARCH_206))
return 0;


}

Can you boot with CONFIG_PPC_MEM_KEYS=n ?

-aneesh


[PASEMI] Nemo board doesn't boot anymore after the commit "powerpc/book3s64/pkeys: Simplify pkey disable branch"

2020-08-09 Thread Christian Zigotzky

Hello,

The Nemo board (A-EON AmigaOne X1000) [1] doesn't start with the latest 
Git kernel anymore after the commit "powerpc/book3s64/pkeys: Simplify 
pkey disable branch" [2].


I bisected today [3].

Result: powerpc/book3s64/pkeys: Simplify pkey disable branch 
(a4678d4b477c3d2901f101986ca01406f3b7eaea) [2] is the first bad commit.


Unfortunately I wasn't able to revert the first bad commit. The first 
bad commit depends on many other commits, which unfortunately I don't 
know. I tried to remove the modifications of the files from the first 
bad commit but without any success. There are just too many dependencies.


Additionally I reverted the commit "selftests/powerpc: Fix pkey syscall 
redefinitions" [4] and compiled a new kernel but without any success.


Could you please check the first bad commit?

Thanks,
Christian


[1] https://en.wikipedia.org/wiki/AmigaOne_X1000
[2] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a4678d4b477c3d2901f101986ca01406f3b7eaea

[3] https://forum.hyperion-entertainment.com/viewtopic.php?p=51340#p51340
[4] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a7aaa2f26bfd932a654706b19859e7adf802bee2