summaryrefslogtreecommitdiffstats
path: root/virt/kvm/arm/hyp/timer-sr.c
diff options
context:
space:
mode:
authorJintack Lim2017-02-03 16:20:00 +0100
committerMarc Zyngier2017-02-08 16:13:33 +0100
commit90de943a430028ee389b22bf4a7ae5867c32ce0c (patch)
tree80c64f76f1be349523dd346933858ed9c730fb1f /virt/kvm/arm/hyp/timer-sr.c
parentKVM: arm/arm64: Abstract virtual timer context into separate structure (diff)
downloadkernel-qcow2-linux-90de943a430028ee389b22bf4a7ae5867c32ce0c.tar.gz
kernel-qcow2-linux-90de943a430028ee389b22bf4a7ae5867c32ce0c.tar.xz
kernel-qcow2-linux-90de943a430028ee389b22bf4a7ae5867c32ce0c.zip
KVM: arm/arm64: Move cntvoff to each timer context
Make cntvoff per each timer context. This is helpful to abstract kvm timer functions to work with timer context without considering timer types (e.g. physical timer or virtual timer). This also would pave the way for ever doing adjustments of the cntvoff on a per-CPU basis if that should ever make sense. Signed-off-by: Jintack Lim <jintack@cs.columbia.edu> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'virt/kvm/arm/hyp/timer-sr.c')
-rw-r--r--virt/kvm/arm/hyp/timer-sr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/virt/kvm/arm/hyp/timer-sr.c b/virt/kvm/arm/hyp/timer-sr.c
index 0cf08953e81c..4734915ab71f 100644
--- a/virt/kvm/arm/hyp/timer-sr.c
+++ b/virt/kvm/arm/hyp/timer-sr.c
@@ -53,7 +53,6 @@ void __hyp_text __timer_save_state(struct kvm_vcpu *vcpu)
void __hyp_text __timer_restore_state(struct kvm_vcpu *vcpu)
{
- struct kvm *kvm = kern_hyp_va(vcpu->kvm);
struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
struct arch_timer_context *vtimer = vcpu_vtimer(vcpu);
u64 val;
@@ -71,7 +70,7 @@ void __hyp_text __timer_restore_state(struct kvm_vcpu *vcpu)
}
if (timer->enabled) {
- write_sysreg(kvm->arch.timer.cntvoff, cntvoff_el2);
+ write_sysreg(vtimer->cntvoff, cntvoff_el2);
write_sysreg_el0(vtimer->cnt_cval, cntv_cval);
isb();
write_sysreg_el0(vtimer->cnt_ctl, cntv_ctl);