KVM: arm64: sve: Use __vcpu_sys_reg() instead of raw sys_regs access
authorMarc Zyngier <maz@kernel.org>
Thu, 4 Jul 2019 16:25:09 +0000 (17:25 +0100)
committerMarc Zyngier <maz@kernel.org>
Tue, 7 Jul 2020 08:28:37 +0000 (09:28 +0100)
Now that we have a wrapper for the sysreg accesses, let's use that
consistently.

Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/fpsimd.c

index e329a36..e503caf 100644 (file)
@@ -109,12 +109,10 @@ void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu)
        local_irq_save(flags);
 
        if (vcpu->arch.flags & KVM_ARM64_FP_ENABLED) {
-               u64 *guest_zcr = &vcpu->arch.ctxt.sys_regs[ZCR_EL1];
-
                fpsimd_save_and_flush_cpu_state();
 
                if (guest_has_sve)
-                       *guest_zcr = read_sysreg_s(SYS_ZCR_EL12);
+                       __vcpu_sys_reg(vcpu, ZCR_EL1) = read_sysreg_s(SYS_ZCR_EL12);
        } else if (host_has_sve) {
                /*
                 * The FPSIMD/SVE state in the CPU has not been touched, and we