aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm/hyp/hyp-entry.S
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2020-09-18 12:25:40 +0100
committerWill Deacon <will@kernel.org>2020-09-29 16:08:16 +0100
commit29e8910a566aad3ee72f729e45842858d51ced8d (patch)
tree24f724d8fc710a804931c0adcbe1418794491e56 /arch/arm64/kvm/hyp/hyp-entry.S
parentarm64: Rewrite Spectre-v4 mitigation code (diff)
downloadlinux-dev-29e8910a566aad3ee72f729e45842858d51ced8d.tar.xz
linux-dev-29e8910a566aad3ee72f729e45842858d51ced8d.zip
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/hyp/hyp-entry.S')
-rw-r--r--arch/arm64/kvm/hyp/hyp-entry.S27
1 files changed, 0 insertions, 27 deletions
diff --git a/arch/arm64/kvm/hyp/hyp-entry.S b/arch/arm64/kvm/hyp/hyp-entry.S
index db2dd7500617..3cca756e9e41 100644
--- a/arch/arm64/kvm/hyp/hyp-entry.S
+++ b/arch/arm64/kvm/hyp/hyp-entry.S
@@ -116,33 +116,6 @@ el1_hvc_guest:
ARM_SMCCC_ARCH_WORKAROUND_2)
cbnz w1, el1_trap
-alternative_cb arm64_enable_wa2_handling
- b wa2_end
-alternative_cb_end
- get_vcpu_ptr x2, x0
- ldr x0, [x2, #VCPU_WORKAROUND_FLAGS]
-
- // Sanitize the argument and update the guest flags
- ldr x1, [sp, #8] // Guest's x1
- clz w1, w1 // Murphy's device:
- lsr w1, w1, #5 // w1 = !!w1 without using
- eor w1, w1, #1 // the flags...
- bfi x0, x1, #VCPU_WORKAROUND_2_FLAG_SHIFT, #1
- str x0, [x2, #VCPU_WORKAROUND_FLAGS]
-
- /* Check that we actually need to perform the call */
- hyp_ldr_this_cpu x0, arm64_ssbd_callback_required, x2
- cbz x0, wa2_end
-
- mov w0, #ARM_SMCCC_ARCH_WORKAROUND_2
- smc #0
-
- /* Don't leak data from the SMC call */
- mov x3, xzr
-wa2_end:
- mov x2, xzr
- mov x1, xzr
-
wa_epilogue:
mov x0, xzr
add sp, sp, #16