Skip to content

Commit b61fae4

Browse files
author
Marc Zyngier
committed
KVM: arm64: Don't use __vcpu_sys_reg() to get the address of a sysreg
We are about to prevent the use of __vcpu_sys_reg() as a lvalue, and getting the address of a rvalue is not a thing. Update the couple of places where we do this to use the __ctxt_sys_reg() accessor, which return the address of a register. Reviewed-by: Miguel Luis <[email protected]> Reviewed-by: Oliver Upton <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent 8800b7c commit b61fae4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arch/arm64/kvm/arch_timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ void kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu)
10361036
if (vcpu_has_nv(vcpu)) {
10371037
struct arch_timer_offset *offs = &vcpu_vtimer(vcpu)->offset;
10381038

1039-
offs->vcpu_offset = &__vcpu_sys_reg(vcpu, CNTVOFF_EL2);
1039+
offs->vcpu_offset = __ctxt_sys_reg(&vcpu->arch.ctxt, CNTVOFF_EL2);
10401040
offs->vm_offset = &vcpu->kvm->arch.timer_data.poffset;
10411041
}
10421042

arch/arm64/kvm/fpsimd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ void kvm_arch_vcpu_ctxsync_fp(struct kvm_vcpu *vcpu)
103103
fp_state.sve_state = vcpu->arch.sve_state;
104104
fp_state.sve_vl = vcpu->arch.sve_max_vl;
105105
fp_state.sme_state = NULL;
106-
fp_state.svcr = &__vcpu_sys_reg(vcpu, SVCR);
107-
fp_state.fpmr = &__vcpu_sys_reg(vcpu, FPMR);
106+
fp_state.svcr = __ctxt_sys_reg(&vcpu->arch.ctxt, SVCR);
107+
fp_state.fpmr = __ctxt_sys_reg(&vcpu->arch.ctxt, FPMR);
108108
fp_state.fp_type = &vcpu->arch.fp_type;
109109

110110
if (vcpu_has_sve(vcpu))

0 commit comments

Comments
 (0)