summaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2013-03-26 14:41:35 +0100
committerMark Rutland <mark.rutland@arm.com>2013-06-07 11:20:27 +0200
commitf793c23ebbe5afd1cabf4a42a3a297022213756f (patch)
tree020318db2b30ce500241d60480ea96bcbadf1b78 /arch/arm/kvm
parentARM: hyp: initialize CNTVOFF to zero (diff)
downloadlinux-f793c23ebbe5afd1cabf4a42a3a297022213756f.tar.xz
linux-f793c23ebbe5afd1cabf4a42a3a297022213756f.zip
ARM: KVM: arch_timers: zero CNTVOFF upon return to host
To use the virtual counters from the host, we need to ensure that CNTVOFF doesn't change unexpectedly. When we change to a guest, we replace the host's CNTVOFF, but we don't restore it when returning to the host. As the host sets CNTVOFF to zero, and never changes it, we can simply zero CNTVOFF when returning to the host. This patch adds said zeroing to the return to host path. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Christoffer Dall <cdall@cs.columbia.edu>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r--arch/arm/kvm/interrupts_head.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S
index 3c8f2f0b4c5e..d43cfb5b37c4 100644
--- a/arch/arm/kvm/interrupts_head.S
+++ b/arch/arm/kvm/interrupts_head.S
@@ -497,6 +497,10 @@ vcpu .req r0 @ vcpu pointer always in r0
add r5, vcpu, r4
strd r2, r3, [r5]
+ @ Ensure host CNTVCT == CNTPCT
+ mov r2, #0
+ mcrr p15, 4, r2, r2, c14 @ CNTVOFF
+
1:
#endif
@ Allow physical timer/counter access for the host