arm64: KVM: Propagate full Spectre v2 workaround state to KVM guests
authorAndre Przywara <andre.przywara@arm.com>
Fri, 3 May 2019 14:27:48 +0000 (15:27 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 5 Jul 2019 12:56:27 +0000 (13:56 +0100)
commitc118bbb52743df70e6297671606c1c08edc659fe
tree3058edcfc6f08fa7b68f9e5ff037c9dc219255a6
parent80f393a23be68e2f8a0f74258d6155438c200bbd
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>
arch/arm/include/asm/kvm_host.h
arch/arm64/include/asm/cpufeature.h
arch/arm64/include/asm/kvm_host.h
arch/arm64/kernel/cpu_errata.c
virt/kvm/arm/psci.c