summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/mman.h
diff options
context:
space:
mode:
authorShawn Anastasio <shawn@anastas.io>2020-08-21 13:55:57 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2020-08-24 14:12:54 +1000
commit9b725a90a8f127802e19466d4e336e701bcea0d2 (patch)
tree03641564d277fa36483be5cef7fce5deb8454572 /arch/powerpc/include/asm/mman.h
parent12564485ed8caac3c18572793ec01330792c7191 (diff)
powerpc/64s: Disallow PROT_SAO in LPARs by default
Since migration of guests using SAO to ISA 3.1 hosts may cause issues, disable PROT_SAO in LPARs by default and introduce a new Kconfig option PPC_PROT_SAO_LPAR to allow users to enable it if desired. Signed-off-by: Shawn Anastasio <shawn@anastas.io> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200821185558.35561-3-shawn@anastas.io
Diffstat (limited to 'arch/powerpc/include/asm/mman.h')
-rw-r--r--arch/powerpc/include/asm/mman.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/mman.h b/arch/powerpc/include/asm/mman.h
index 4ba303ea27f5..7cb6d18f5cd6 100644
--- a/arch/powerpc/include/asm/mman.h
+++ b/arch/powerpc/include/asm/mman.h
@@ -40,8 +40,13 @@ static inline bool arch_validate_prot(unsigned long prot, unsigned long addr)
{
if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM | PROT_SAO))
return false;
- if ((prot & PROT_SAO) && !cpu_has_feature(CPU_FTR_SAO))
- return false;
+ if (prot & PROT_SAO) {
+ if (!cpu_has_feature(CPU_FTR_SAO))
+ return false;
+ if (firmware_has_feature(FW_FEATURE_LPAR) &&
+ !IS_ENABLED(CONFIG_PPC_PROT_SAO_LPAR))
+ return false;
+ }
return true;
}
#define arch_validate_prot arch_validate_prot