diff options
author | Andre Przywara <andre.przywara@arm.com> | 2019-05-03 15:27:48 +0100 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2019-07-05 13:56:27 +0100 |
commit | c118bbb52743df70e6297671606c1c08edc659fe (patch) | |
tree | 3058edcfc6f08fa7b68f9e5ff037c9dc219255a6 /arch/arm64/include/asm/cpufeature.h | |
parent | 80f393a23be68e2f8a0f74258d6155438c200bbd (diff) | |
download | linux-c118bbb52743df70e6297671606c1c08edc659fe.tar.gz linux-c118bbb52743df70e6297671606c1c08edc659fe.tar.bz2 linux-c118bbb52743df70e6297671606c1c08edc659fe.zip |
arm64: KVM: Propagate full Spectre v2 workaround state to KVM guests
Recent commits added the explicit notion of "workaround not required" to
the state of the Spectre v2 (aka. BP_HARDENING) workaround, where we
just had "needed" and "unknown" before.
Export this knowledge to the rest of the kernel and enhance the existing
kvm_arm_harden_branch_predictor() to report this new state as well.
Export this new state to guests when they use KVM's firmware interface
emulation.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/cpufeature.h')
-rw-r--r-- | arch/arm64/include/asm/cpufeature.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index 373799b7982f..948427f6b3d9 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h @@ -614,6 +614,12 @@ static inline bool system_uses_irq_prio_masking(void) cpus_have_const_cap(ARM64_HAS_IRQ_PRIO_MASKING); } +#define ARM64_BP_HARDEN_UNKNOWN -1 +#define ARM64_BP_HARDEN_WA_NEEDED 0 +#define ARM64_BP_HARDEN_NOT_REQUIRED 1 + +int get_spectre_v2_workaround_state(void); + #define ARM64_SSBD_UNKNOWN -1 #define ARM64_SSBD_FORCE_DISABLE 0 #define ARM64_SSBD_KERNEL 1 |