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

[Xen-devel] [PATCH] pvh: add a call to pit_init to init spinlock



During halt of a pvh guest, the guest may do speaker shutdown. This
results in call to handle_speaker_io in xen. It will hang on the vpit
spin lock because it has not been initialized via pit_init, which is
called for both pv and hvm. This patch adds a call to it for pvh.

Signed-off-by: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c   | 3 +++
 xen/arch/x86/hvm/i8254.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9e85c13..07e44f6 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1299,6 +1299,9 @@ int hvm_vcpu_initialise(struct vcpu *v)
         v->arch.hvm_vcpu.hcall_64bit = 1;    /* PVH 32bitfixme. */
         /* This is for hvm_long_mode_enabled(v). */
         v->arch.hvm_vcpu.guest_efer = EFER_SCE | EFER_LMA | EFER_LME;
+
+        if ( v->vcpu_id == 0 )
+            pit_init(v, cpu_khz);
         return 0;
     }
 
diff --git a/xen/arch/x86/hvm/i8254.c b/xen/arch/x86/hvm/i8254.c
index c0d6bc2..08325b5 100644
--- a/xen/arch/x86/hvm/i8254.c
+++ b/xen/arch/x86/hvm/i8254.c
@@ -454,6 +454,9 @@ void pit_init(struct vcpu *v, unsigned long cpu_khz)
 
     spin_lock_init(&pit->lock);
 
+    if ( is_pvh_vcpu(v) )
+        return;
+
     if ( is_hvm_domain(d) )
     {
         register_portio_handler(d, PIT_BASE, 4, handle_pit_io);
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.