summaryrefslogtreecommitdiff
path: root/arch/arm64/kvm/fpsimd.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2021-03-12 14:30:52 +0000
committerMarc Zyngier <maz@kernel.org>2021-03-18 13:57:54 +0000
commitb145a8437aab2799969f6ad8e384b557872333c2 (patch)
tree2bb9ba9ad3c5278d44aaf82867fd3fd8be82f03d /arch/arm64/kvm/fpsimd.c
parent0a9a98fda3a24b0775ace4be096290b221f2f6a5 (diff)
KVM: arm64: Save guest's ZCR_EL1 before saving the FPSIMD state
Make sure the guest's ZCR_EL1 is saved before we save/flush the state. This will be useful in later patches. Acked-by: Will Deacon <will@kernel.org> Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/kvm/fpsimd.c')
-rw-r--r--arch/arm64/kvm/fpsimd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/kvm/fpsimd.c b/arch/arm64/kvm/fpsimd.c
index 3c37a419fa82..14ea05c5134a 100644
--- a/arch/arm64/kvm/fpsimd.c
+++ b/arch/arm64/kvm/fpsimd.c
@@ -121,10 +121,10 @@ void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu)
local_irq_save(flags);
if (vcpu->arch.flags & KVM_ARM64_FP_ENABLED) {
- fpsimd_save_and_flush_cpu_state();
-
if (guest_has_sve)
__vcpu_sys_reg(vcpu, ZCR_EL1) = read_sysreg_el1(SYS_ZCR);
+
+ fpsimd_save_and_flush_cpu_state();
} else if (host_has_sve) {
/*
* The FPSIMD/SVE state in the CPU has not been touched, and we