Skip to contentSkip to conversation

powerpc/book3s64/pkey: Disable pkey on POWER6 and before

PATCH Superseded Aneesh Kumar K.V 1 participant 1 message Jul 26, 2020 PowerPC

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/book3s64/pkey: Disable pkey on POWER6 and before

POWER6 only support AMR update via privileged mode(MSR[PR] = 0, SPRN_AMR=29) The PR=1 alias for that SPR (SPRN_AMR=13) was only supported from POWER7. Since we don't allow userspace modifying of AMR value we should disable pkey support on P6 and before.

The hypervisor will still report pkey support via ibm,processor-storage-keys. Hence check for P7 CPU_FTR bit to decide on pkey support.

Fixes a24204c30796 ("powerpc/book3s64/pkeys: kill cpu feature key CPU_FTR_PKEY")
---
 arch/powerpc/mm/book3s64/pkeys.c | 3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/mm/book3s64/pkeys.c +3 -0
index 792b36aa9619..320315266969 100644
@@ -73,6 +73,9 @@ static int scan_pkey_feature(void)
 	if (early_radix_enabled())
 		return 0;
 
+	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) {
 		/*
Signature · 1 line
2.26.2