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

Re: [Xen-devel] xen-unstable (4.14 to be): Assertion '!preempt_count()' failed at preempt.c:36



> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: 05 December 2019 08:44
> To: Durrant, Paul <pdurrant@xxxxxxxxxx>
> Cc: Sander Eikelenboom <linux@xxxxxxxxxxxxxx>; xen-
> devel@xxxxxxxxxxxxxxxxxxxx; Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>;
> Paul Durrant <paul@xxxxxxx>
> Subject: Re: xen-unstable (4.14 to be): Assertion '!preempt_count()'
> failed at preempt.c:36
> 
> On 05.12.2019 09:35, Durrant, Paul wrote:
> > --- a/xen/drivers/passthrough/pci.c
> > +++ b/xen/drivers/passthrough/pci.c
> > @@ -1696,16 +1696,12 @@ int iommu_do_pci_domctl(
> >
> >          pcidevs_lock();
> >          ret = device_assigned(seg, bus, devfn);
> > -        if ( domctl->cmd == XEN_DOMCTL_test_assign_device )
> > +        if ( ret && domctl->cmd == XEN_DOMCTL_test_assign_device )
> >          {
> > -            if ( ret )
> > -            {
> > -                printk(XENLOG_G_INFO
> > -                       "%04x:%02x:%02x.%u already assigned, or non-
> existent\n",
> > -                       seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
> > -                ret = -EINVAL;
> > -            }
> > -            break;
> > +            printk(XENLOG_G_INFO
> > +                   "%04x:%02x:%02x.%u already assigned, or non-
> existent\n",
> > +                   seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
> > +            ret = -EINVAL;
> >          }
> 
> But this seems wrong - you'd end up calling assign_device() even
> for the XEN_DOMCTL_test_assign_device case, when ret is 0. All we
> want is to delete the break statement afaict.
> 

Ah, yes; that logic is quite confusing. The patch should indeed be:

---8<---
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index ced0c28e4f..c07a63981a 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1705,7 +1705,6 @@ int iommu_do_pci_domctl(
                        seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
                 ret = -EINVAL;
             }
-            break;
         }
         else if ( !ret )
             ret = assign_device(d, seg, bus, devfn, flags);
---8<---

> Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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