Skip to content

Commit

Permalink
ARM: KVM: arch_timers: zero CNTVOFF upon return to host
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Rutland committed Jun 7, 2013
1 parent 0af0b18 commit f793c23
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/arm/kvm/interrupts_head.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f793c23

Please sign in to comment.