diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2015-09-16 11:18:59 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2015-09-17 08:11:48 -0400 |
commit | 688bc577ac42ae3d07c889a1f0a72f0b23763d58 (patch) | |
tree | ac60254c2d0efd4d0eb7bd44aef406566bae880d /arch/arm | |
parent | c4cbba9fa078f55d9f6d081dbb4aec7cf969e7c7 (diff) |
arm: KVM: Disable virtual timer even if the guest is not using it
When running a guest with the architected timer disabled (with QEMU and
the kernel_irqchip=off option, for example), it is important to make
sure the timer gets turned off. Otherwise, the guest may try to
enable it anyway, leading to a screaming HW interrupt.
The fix is to unconditionally turn off the virtual timer on guest
exit.
Cc: stable@vger.kernel.org
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/kvm/interrupts_head.S | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S index 702740d37465..51a59504bef4 100644 --- a/arch/arm/kvm/interrupts_head.S +++ b/arch/arm/kvm/interrupts_head.S | |||
@@ -515,8 +515,7 @@ ARM_BE8(rev r6, r6 ) | |||
515 | 515 | ||
516 | mrc p15, 0, r2, c14, c3, 1 @ CNTV_CTL | 516 | mrc p15, 0, r2, c14, c3, 1 @ CNTV_CTL |
517 | str r2, [vcpu, #VCPU_TIMER_CNTV_CTL] | 517 | str r2, [vcpu, #VCPU_TIMER_CNTV_CTL] |
518 | bic r2, #1 @ Clear ENABLE | 518 | |
519 | mcr p15, 0, r2, c14, c3, 1 @ CNTV_CTL | ||
520 | isb | 519 | isb |
521 | 520 | ||
522 | mrrc p15, 3, rr_lo_hi(r2, r3), c14 @ CNTV_CVAL | 521 | mrrc p15, 3, rr_lo_hi(r2, r3), c14 @ CNTV_CVAL |
@@ -529,6 +528,9 @@ ARM_BE8(rev r6, r6 ) | |||
529 | mcrr p15, 4, r2, r2, c14 @ CNTVOFF | 528 | mcrr p15, 4, r2, r2, c14 @ CNTVOFF |
530 | 529 | ||
531 | 1: | 530 | 1: |
531 | mov r2, #0 @ Clear ENABLE | ||
532 | mcr p15, 0, r2, c14, c3, 1 @ CNTV_CTL | ||
533 | |||
532 | @ Allow physical timer/counter access for the host | 534 | @ Allow physical timer/counter access for the host |
533 | mrc p15, 4, r2, c14, c1, 0 @ CNTHCTL | 535 | mrc p15, 4, r2, c14, c1, 0 @ CNTHCTL |
534 | orr r2, r2, #(CNTHCTL_PL1PCEN | CNTHCTL_PL1PCTEN) | 536 | orr r2, r2, #(CNTHCTL_PL1PCEN | CNTHCTL_PL1PCTEN) |