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

Re: [Xen-devel] XEN 4.1.3-rc1 bug, spinlock acquired twice



On Sat, 28 Jan 2012, Keir Fraser wrote:
> On 27/01/2012 23:20, "Paulian Bogdan Marinca" <paulian@xxxxxxxxxxx> wrote:
> 
> > I have a testing intel machine with 4 physical cpus running 64 bit Xen
> > 4.1.3-rc1.
> > 
> > I have a particular linux VM for which at its kernel boot time ( as
> > domU ) it makes the XEN and Dom0 unresponsive (even the XEN serial
> > console freezes indefinitely). The domU linux kernel is 3.2.1 and has
> > XEN compiled in.
> > 
> > Trying to find where the problem is, I found this: at the point where
> > XEN/Dom0 freezes, the physical cpus 0, 1 and 2 are executing the
> > idle_loop() from xen/arch/x86/domain.c and the cpu 3 spins
> > indefinitely in the
> 
> Thanks, the offending patch is xen-unstable:22409, I think. It needs an HVM
> guest which maps emulated IRQs onto event channels, but then has event
> channel notifications mapped onto an emulated IRQ (rather than 'direct
> vector delivery'). An unlikely state of affairs, maybe it's a temporary
> setup during guest boot, or maybe it indicates a bug in the guest as well.

That's right, this scenario should not be possible because whenever
XENFEAT_hvm_pirqs is available, XENFEAT_hvm_callback_vector should also
be available.
In any case I'll submit a patch to Linux to make sure this doesn't
happen, explicitly checking for xen_have_vector_callback.
What is your Linux kernel version? Could you please post your kernel
config as well?


> In any case, cc'ing the author, Stefano. This ought to be easy to fix. We
> could make the irq_lock a recursive lock for example.

We could also fail to map irqs into event channels if the delivery
method is not HVMIRQ_callback_vector:


diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index df92cc7..7d89ed6 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -93,6 +93,11 @@ int physdev_map_pirq(domid_t domid, int type, int *index, 
int *pirq_p,
 
     if ( domid == DOMID_SELF && is_hvm_domain(d) )
     {
+        if ( !is_hvm_pv_evtchn_domain(d) )
+        {
+            ret = -EINVAL;
+            goto free_domain;
+        }
         ret = physdev_hvm_map_pirq(d, type, index, pirq_p);
         goto free_domain;
     }

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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