[Android-virt] [PATCH 05/10] ARM: KVM: Allow the host to use the physical timer from PL1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As the host kernel has to move its timer from virtual to physical,
let's make sure it has access to it. Otherwise, it would blow
at a very early stage.

Signed-off-by: Marc Zyngier <marc.zyngier at arm.com>
---
 arch/arm/kvm/init.S |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S
index 0bcc739..ce477ba 100644
--- a/arch/arm/kvm/init.S
+++ b/arch/arm/kvm/init.S
@@ -101,6 +101,11 @@ __do_hyp_init:
 	mcr	p15, 4, r0, c1, c0, 0	@ HSCR
 	isb
 
+	@ make CNTP_* and CNTPCT accessible from PL1
+	mrc	p15, 4, r0, c14, c1, 0	@ CNTHCTL
+	orr	r0, r0, #3		@ PL1PCEN | PL1PCTEN
+	mcr	p15, 4, r0, c14, c1, 0	@ CNTHCTL
+
 	@ Set stack pointer and return to the kernel
 	pop	{r0, r1, r2, r12}
 	mov	sp, r1
-- 
1.7.7.1





[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux