xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Durrant, Paul" <pdurrant@amazon.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Paul Durrant <paul@xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Igor Druzhinin <igor.druzhinin@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] xen-unstable (4.14 to be): Assertion '!preempt_count()' failed at preempt.c:36
Date: Thu, 5 Dec 2019 08:47:55 +0000	[thread overview]
Message-ID: <3ccdae5d7e3e4c178413d2d22f483efb@EX13D32EUC003.ant.amazon.com> (raw)
In-Reply-To: <c9ef56d9-9220-72e5-8ea6-0bd87436991b@suse.com>

> -----Original Message-----
> From: Jan Beulich <jbeulich@suse.com>
> Sent: 05 December 2019 08:44
> To: Durrant, Paul <pdurrant@amazon.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>; xen-
> devel@lists.xenproject.org; Igor Druzhinin <igor.druzhinin@citrix.com>;
> Paul Durrant <paul@xen.org>
> 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@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

      reply	other threads:[~2019-12-05  8:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 17:21 [Xen-devel] xen-unstable (4.14 to be): Assertion '!preempt_count()' failed at preempt.c:36 Sander Eikelenboom
2019-12-04 17:30 ` Jan Beulich
2019-12-04 21:03   ` Sander Eikelenboom
2019-12-05  8:35     ` Durrant, Paul
2019-12-05  8:43       ` Jan Beulich
2019-12-05  8:47         ` Durrant, Paul [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ccdae5d7e3e4c178413d2d22f483efb@EX13D32EUC003.ant.amazon.com \
    --to=pdurrant@amazon.com \
    --cc=igor.druzhinin@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=linux@eikelenboom.it \
    --cc=paul@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).