提交 8b2cca9a 编写于 作者: M Marc Zyngier 提交者: Will Deacon

arm64: KVM: Force VHE for systems affected by erratum 1165522

In order to easily mitigate ARM erratum 1165522, we need to force
affected CPUs to run in VHE mode if using KVM.
Reviewed-by: NJames Morse <james.morse@arm.com>
Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 793d5d92
...@@ -54,7 +54,8 @@ ...@@ -54,7 +54,8 @@
#define ARM64_HAS_CRC32 33 #define ARM64_HAS_CRC32 33
#define ARM64_SSBS 34 #define ARM64_SSBS 34
#define ARM64_WORKAROUND_1188873 35 #define ARM64_WORKAROUND_1188873 35
#define ARM64_WORKAROUND_1165522 36
#define ARM64_NCAPS 36 #define ARM64_NCAPS 37
#endif /* __ASM_CPUCAPS_H */ #endif /* __ASM_CPUCAPS_H */
...@@ -432,6 +432,10 @@ static inline bool kvm_arch_requires_vhe(void) ...@@ -432,6 +432,10 @@ static inline bool kvm_arch_requires_vhe(void)
if (system_supports_sve()) if (system_supports_sve())
return true; return true;
/* Some implementations have defects that confine them to VHE */
if (cpus_have_cap(ARM64_WORKAROUND_1165522))
return true;
return false; return false;
} }
......
...@@ -739,6 +739,14 @@ const struct arm64_cpu_capabilities arm64_errata[] = { ...@@ -739,6 +739,14 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
.capability = ARM64_WORKAROUND_1188873, .capability = ARM64_WORKAROUND_1188873,
ERRATA_MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 2, 0), ERRATA_MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 2, 0),
}, },
#endif
#ifdef CONFIG_ARM64_ERRATUM_1165522
{
/* Cortex-A76 r0p0 to r2p0 */
.desc = "ARM erratum 1165522",
.capability = ARM64_WORKAROUND_1165522,
ERRATA_MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 2, 0),
},
#endif #endif
{ {
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册