Commit 269e829f authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Michael Ellerman

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

POWER6 only supports AMR update via privileged mode (MSR[PR] = 0,
SPRN_AMR=29) The PR=1 (userspace) 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 also check for P7 CPU_FTR bit to
decide on pkey support.

Fixes: f491fe3f ("powerpc/book3s64/pkeys: Simplify the key initialization")
Reported-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200726132517.399076-1-aneesh.kumar@linux.ibm.com
parent 826b07b1
...@@ -73,6 +73,12 @@ static int scan_pkey_feature(void) ...@@ -73,6 +73,12 @@ static int scan_pkey_feature(void)
if (early_radix_enabled()) if (early_radix_enabled())
return 0; 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); ret = of_scan_flat_dt(dt_scan_storage_keys, &pkeys_total);
if (ret == 0) { if (ret == 0) {
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment