Skip to content

Commit 6553fb7

Browse files
kvaneeshmpe
authored andcommitted
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: 269e829 ("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]
1 parent 7b9de97 commit 6553fb7

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

arch/powerpc/mm/book3s64/hash_utils.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,9 +1115,8 @@ void hash__early_init_mmu_secondary(void)
11151115
&& cpu_has_feature(CPU_FTR_HVMODE))
11161116
tlbiel_all();
11171117

1118-
#ifdef CONFIG_PPC_MEM_KEYS
1119-
mtspr(SPRN_UAMOR, default_uamor);
1120-
#endif
1118+
if (IS_ENABLED(CONFIG_PPC_MEM_KEYS) && mmu_has_feature(MMU_FTR_PKEY))
1119+
mtspr(SPRN_UAMOR, default_uamor);
11211120
}
11221121
#endif /* CONFIG_SMP */
11231122

arch/powerpc/mm/book3s64/pkeys.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ static int scan_pkey_feature(void)
7373
if (early_radix_enabled())
7474
return 0;
7575

76-
/*
77-
* Only P7 and above supports SPRN_AMR update with MSR[PR] = 1
78-
*/
79-
if (!early_cpu_has_feature(CPU_FTR_ARCH_206))
80-
return 0;
81-
8276
ret = of_scan_flat_dt(dt_scan_storage_keys, &pkeys_total);
8377
if (ret == 0) {
8478
/*
@@ -124,6 +118,12 @@ void __init pkey_early_init_devtree(void)
124118
__builtin_popcountl(ARCH_VM_PKEY_FLAGS >> VM_PKEY_SHIFT)
125119
!= (sizeof(u64) * BITS_PER_BYTE));
126120

121+
/*
122+
* Only P7 and above supports SPRN_AMR update with MSR[PR] = 1
123+
*/
124+
if (!early_cpu_has_feature(CPU_FTR_ARCH_206))
125+
return;
126+
127127
/* scan the device tree for pkey feature */
128128
pkeys_total = scan_pkey_feature();
129129
if (!pkeys_total)

0 commit comments

Comments
 (0)