diff options
author | Marc Zyngier <Marc.Zyngier@arm.com> | 2013-03-12 14:56:12 +0000 |
---|---|---|
committer | Mark Rutland <mark.rutland@arm.com> | 2013-06-07 10:20:29 +0100 |
commit | 3f71be237ce37e0131973ebfa33b326bc51d743e (patch) | |
tree | a6ddb377465fc75e952173ec1b754aca978865eb /arch/arm/kernel | |
parent | fb521a0da1551468a45f2e2a1c1941d0033357ea (diff) | |
download | op-kernel-dev-3f71be237ce37e0131973ebfa33b326bc51d743e.zip op-kernel-dev-3f71be237ce37e0131973ebfa33b326bc51d743e.tar.gz |
ARM: arch_timer: stop virtual timer when booted in HYP mode
When booting the kernel, a bootloader could have left the virtual
timer ticking away, potentially generating interrupts. This could
be troublesome if the user of the virtual timer is not careful
when enabling the interrupt.
In order to avoid any surprise, stop the virtual timer from
interrupting us when booted in HYP mode, as we'll use the physical
timer in this case.
Reported-by: Giridhar Maruthy <giridhar.m@samsung.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Dave Martin <dave.martin@linaro.org>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/hyp-stub.S | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S index dbe2110..4910232 100644 --- a/arch/arm/kernel/hyp-stub.S +++ b/arch/arm/kernel/hyp-stub.S @@ -155,6 +155,11 @@ THUMB( orr r7, #(1 << 30) ) @ HSCTLR.TE mcr p15, 4, r7, c14, c1, 0 @ CNTHCTL mov r7, #0 mcrr p15, 4, r7, r7, c14 @ CNTVOFF + + @ Disable virtual timer in case it was counting + mrc p15, 0, r7, c14, c3, 1 @ CNTV_CTL + bic r7, #1 @ Clear ENABLE + mcr p15, 0, r7, c14, c3, 1 @ CNTV_CTL 1: #endif |