]> Git Repo - linux.git/commitdiff
powerpc/pkeys: Fix boot failures with Nemo board (A-EON AmigaOne X1000)
authorAneesh Kumar K.V <[email protected]>
Mon, 10 Aug 2020 10:26:23 +0000 (15:56 +0530)
committerMichael Ellerman <[email protected]>
Mon, 10 Aug 2020 13:07:21 +0000 (23:07 +1000)
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 <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
arch/powerpc/mm/book3s64/hash_utils.c
arch/powerpc/mm/book3s64/pkeys.c

index 1478fceeb683ce466d9f0f57705349a4b8dff79b..1da9dbba92171b9afc9fffb5f9e1ce67d96c7e71 100644 (file)
@@ -1115,9 +1115,8 @@ void hash__early_init_mmu_secondary(void)
                        && cpu_has_feature(CPU_FTR_HVMODE))
                tlbiel_all();
 
-#ifdef CONFIG_PPC_MEM_KEYS
-       mtspr(SPRN_UAMOR, default_uamor);
-#endif
+       if (IS_ENABLED(CONFIG_PPC_MEM_KEYS) && mmu_has_feature(MMU_FTR_PKEY))
+               mtspr(SPRN_UAMOR, default_uamor);
 }
 #endif /* CONFIG_SMP */
 
index 69a6b87f2bb4e384a6892f1fa2ee5858af8de9fb..b1d091a9761193211a4682201caa2428c18cadf9 100644 (file)
@@ -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, &pkeys_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)
This page took 0.060343 seconds and 4 git commands to generate.