aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/arm_arch_timer.c
diff options
context:
space:
mode:
authorMarc Zyngier <Marc.Zyngier@arm.com>2013-01-10 06:13:07 -0500
committerMark Rutland <mark.rutland@arm.com>2013-01-31 10:52:00 -0500
commit8266891e252f35dcb189c3f2371cfa588f8a8818 (patch)
treea708f74df24a68dc2d2560a45f4e543f77e6baa9 /drivers/clocksource/arm_arch_timer.c
parentc2b01e06a9c97cf21ad44b91b3280b0797839a62 (diff)
ARM: arch_timers: switch to physical timers if HYP mode is available
If we're booted in HYP mode, it is possible that we'll run some kind of virtualized environment. In this case, it is a better to switch to the physical timers, and leave the virtual timers to guests. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'drivers/clocksource/arm_arch_timer.c')
-rw-r--r--drivers/clocksource/arm_arch_timer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index ec30a7331587..d7ad425ab9b3 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -19,6 +19,7 @@
19#include <linux/io.h> 19#include <linux/io.h>
20 20
21#include <asm/arch_timer.h> 21#include <asm/arch_timer.h>
22#include <asm/virt.h>
22 23
23#include <clocksource/arm_arch_timer.h> 24#include <clocksource/arm_arch_timer.h>
24 25
@@ -364,10 +365,14 @@ int __init arch_timer_init(void)
364 of_node_put(np); 365 of_node_put(np);
365 366
366 /* 367 /*
368 * If HYP mode is available, we know that the physical timer
369 * has been configured to be accessible from PL1. Use it, so
370 * that a guest can use the virtual timer instead.
371 *
367 * If no interrupt provided for virtual timer, we'll have to 372 * If no interrupt provided for virtual timer, we'll have to
368 * stick to the physical timer. It'd better be accessible... 373 * stick to the physical timer. It'd better be accessible...
369 */ 374 */
370 if (!arch_timer_ppi[VIRT_PPI]) { 375 if (is_hyp_mode_available() || !arch_timer_ppi[VIRT_PPI]) {
371 arch_timer_use_virtual = false; 376 arch_timer_use_virtual = false;
372 377
373 if (!arch_timer_ppi[PHYS_SECURE_PPI] || 378 if (!arch_timer_ppi[PHYS_SECURE_PPI] ||