aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2015-10-28 10:36:20 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2016-02-29 13:34:17 -0500
commit5efe6de13807fe927f0ecc63d83197b5cd3c7782 (patch)
tree5cca5392dbc8ee653fb9d61b03616954d886481d /arch/arm64/kvm
parent68908bf789b7fd376538a4bad8367d5dcb9ec983 (diff)
arm64: KVM: VHE: Use unified sysreg accessors for timer
Switch the timer code to the unified sysreg accessors. Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/kvm')
-rw-r--r--arch/arm64/kvm/hyp/timer-sr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/arm64/kvm/hyp/timer-sr.c b/arch/arm64/kvm/hyp/timer-sr.c
index 1051e5d7320f..f276d9e74411 100644
--- a/arch/arm64/kvm/hyp/timer-sr.c
+++ b/arch/arm64/kvm/hyp/timer-sr.c
@@ -31,12 +31,12 @@ void __hyp_text __timer_save_state(struct kvm_vcpu *vcpu)
31 u64 val; 31 u64 val;
32 32
33 if (kvm->arch.timer.enabled) { 33 if (kvm->arch.timer.enabled) {
34 timer->cntv_ctl = read_sysreg(cntv_ctl_el0); 34 timer->cntv_ctl = read_sysreg_el0(cntv_ctl);
35 timer->cntv_cval = read_sysreg(cntv_cval_el0); 35 timer->cntv_cval = read_sysreg_el0(cntv_cval);
36 } 36 }
37 37
38 /* Disable the virtual timer */ 38 /* Disable the virtual timer */
39 write_sysreg(0, cntv_ctl_el0); 39 write_sysreg_el0(0, cntv_ctl);
40 40
41 /* Allow physical timer/counter access for the host */ 41 /* Allow physical timer/counter access for the host */
42 val = read_sysreg(cnthctl_el2); 42 val = read_sysreg(cnthctl_el2);
@@ -64,8 +64,8 @@ void __hyp_text __timer_restore_state(struct kvm_vcpu *vcpu)
64 64
65 if (kvm->arch.timer.enabled) { 65 if (kvm->arch.timer.enabled) {
66 write_sysreg(kvm->arch.timer.cntvoff, cntvoff_el2); 66 write_sysreg(kvm->arch.timer.cntvoff, cntvoff_el2);
67 write_sysreg(timer->cntv_cval, cntv_cval_el0); 67 write_sysreg_el0(timer->cntv_cval, cntv_cval);
68 isb(); 68 isb();
69 write_sysreg(timer->cntv_ctl, cntv_ctl_el0); 69 write_sysreg_el0(timer->cntv_ctl, cntv_ctl);
70 } 70 }
71} 71}