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
This commit is contained in:
parent
12564485ed
commit
9b725a90a8
@ -860,6 +860,18 @@ config PPC_SUBPAGE_PROT
|
|||||||
|
|
||||||
If unsure, say N here.
|
If unsure, say N here.
|
||||||
|
|
||||||
|
config PPC_PROT_SAO_LPAR
|
||||||
|
bool "Support PROT_SAO mappings in LPARs"
|
||||||
|
depends on PPC_BOOK3S_64
|
||||||
|
help
|
||||||
|
This option adds support for PROT_SAO mappings from userspace
|
||||||
|
inside LPARs on supported CPUs.
|
||||||
|
|
||||||
|
This may cause issues when performing guest migration from
|
||||||
|
a CPU that supports SAO to one that does not.
|
||||||
|
|
||||||
|
If unsure, say N here.
|
||||||
|
|
||||||
config PPC_COPRO_BASE
|
config PPC_COPRO_BASE
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
@ -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))
|
if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM | PROT_SAO))
|
||||||
return false;
|
return false;
|
||||||
if ((prot & PROT_SAO) && !cpu_has_feature(CPU_FTR_SAO))
|
if (prot & PROT_SAO) {
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
#define arch_validate_prot arch_validate_prot
|
#define arch_validate_prot arch_validate_prot
|
||||||
|
Loading…
x
Reference in New Issue
Block a user