[Android-virt] [PATCH v2 5/9] 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 file changed, 5 insertions(+)

diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S
index 4db26cb..10ecdf9 100644
--- a/arch/arm/kvm/init.S
+++ b/arch/arm/kvm/init.S
@@ -105,6 +105,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.10.3





[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