aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2013-03-26 09:41:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-09 15:24:26 -0500
commit6e7be6fc3eb45928bb28ebbedf30a30ed82b35b5 (patch)
tree1536077bbf5807f6055c25e1290c36614367124f
parent3db87d4c3af23cb360f443c1a8b0c0b4278b9f6b (diff)
ARM: KVM: arch_timers: zero CNTVOFF upon return to host
commit f793c23ebbe5afd1cabf4a42a3a297022213756f upstream. 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> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 2b44b95a86dd..6f18695a09cb 100644
--- a/arch/arm/kvm/interrupts_head.S
+++ b/arch/arm/kvm/interrupts_head.S
@@ -503,6 +503,10 @@ vcpu .req r0 @ vcpu pointer always in r0
503 add r5, vcpu, r4 503 add r5, vcpu, r4
504 strd r2, r3, [r5] 504 strd r2, r3, [r5]
505 505
506 @ Ensure host CNTVCT == CNTPCT
507 mov r2, #0
508 mcrr p15, 4, r2, r2, c14 @ CNTVOFF
509
5061: 5101:
507#endif 511#endif
508 @ Allow physical timer/counter access for the host 512 @ Allow physical timer/counter access for the host