diff options
author | Marc Zyngier <maz@kernel.org> | 2020-09-18 12:25:40 +0100 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2020-09-29 16:08:16 +0100 |
commit | 29e8910a566aad3ee72f729e45842858d51ced8d (patch) | |
tree | 24f724d8fc710a804931c0adcbe1418794491e56 /arch/arm64/kvm/hypercalls.c | |
parent | c28762070ca651fe7a981b8f31d972c9b7d2c386 (diff) |
KVM: arm64: Simplify handling of ARCH_WORKAROUND_2
Owing to the fact that the host kernel is always mitigated, we can
drastically simplify the WA2 handling by keeping the mitigation
state ON when entering the guest. This means the guest is either
unaffected or not mitigated.
This results in a nice simplification of the mitigation space,
and the removal of a lot of code that was never really used anyway.
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kvm/hypercalls.c')
-rw-r--r-- | arch/arm64/kvm/hypercalls.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/arm64/kvm/hypercalls.c b/arch/arm64/kvm/hypercalls.c index 413d46b9bc07..69e023dfafce 100644 --- a/arch/arm64/kvm/hypercalls.c +++ b/arch/arm64/kvm/hypercalls.c @@ -36,15 +36,13 @@ int kvm_hvc_call_handler(struct kvm_vcpu *vcpu) } break; case ARM_SMCCC_ARCH_WORKAROUND_2: - switch (kvm_arm_have_ssbd()) { - case KVM_SSBD_FORCE_DISABLE: - case KVM_SSBD_UNKNOWN: + switch (arm64_get_ssbd_state()) { + case ARM64_SSBD_FORCE_DISABLE: + case ARM64_SSBD_UNKNOWN: break; - case KVM_SSBD_KERNEL: - val = SMCCC_RET_SUCCESS; - break; - case KVM_SSBD_FORCE_ENABLE: - case KVM_SSBD_MITIGATED: + case ARM64_SSBD_KERNEL: + case ARM64_SSBD_FORCE_ENABLE: + case ARM64_SSBD_MITIGATED: val = SMCCC_RET_NOT_REQUIRED; break; } |