Commit 5efe6de1 authored by Marc Zyngier's avatar Marc Zyngier

arm64: KVM: VHE: Use unified sysreg accessors for timer

Switch the timer code to the unified sysreg accessors.
Reviewed-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 68908bf7
...@@ -31,12 +31,12 @@ void __hyp_text __timer_save_state(struct kvm_vcpu *vcpu) ...@@ -31,12 +31,12 @@ void __hyp_text __timer_save_state(struct kvm_vcpu *vcpu)
u64 val; u64 val;
if (kvm->arch.timer.enabled) { if (kvm->arch.timer.enabled) {
timer->cntv_ctl = read_sysreg(cntv_ctl_el0); timer->cntv_ctl = read_sysreg_el0(cntv_ctl);
timer->cntv_cval = read_sysreg(cntv_cval_el0); timer->cntv_cval = read_sysreg_el0(cntv_cval);
} }
/* Disable the virtual timer */ /* Disable the virtual timer */
write_sysreg(0, cntv_ctl_el0); write_sysreg_el0(0, cntv_ctl);
/* Allow physical timer/counter access for the host */ /* Allow physical timer/counter access for the host */
val = read_sysreg(cnthctl_el2); val = read_sysreg(cnthctl_el2);
...@@ -64,8 +64,8 @@ void __hyp_text __timer_restore_state(struct kvm_vcpu *vcpu) ...@@ -64,8 +64,8 @@ void __hyp_text __timer_restore_state(struct kvm_vcpu *vcpu)
if (kvm->arch.timer.enabled) { if (kvm->arch.timer.enabled) {
write_sysreg(kvm->arch.timer.cntvoff, cntvoff_el2); write_sysreg(kvm->arch.timer.cntvoff, cntvoff_el2);
write_sysreg(timer->cntv_cval, cntv_cval_el0); write_sysreg_el0(timer->cntv_cval, cntv_cval);
isb(); isb();
write_sysreg(timer->cntv_ctl, cntv_ctl_el0); write_sysreg_el0(timer->cntv_ctl, cntv_ctl);
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment