diff mbox series

passthrough: add missed pcidevs_unlock following c/s cd7dedad820

Message ID 1575495080-27656-1-git-send-email-igor.druzhinin@citrix.com (mailing list archive)
State New, archived
Headers show
Series passthrough: add missed pcidevs_unlock following c/s cd7dedad820 | expand

Commit Message

Igor Druzhinin Dec. 4, 2019, 9:31 p.m. UTC
The locking responsibilities have changed and a premature break in
this section now causes the following assertion:

Assertion '!preempt_count()' failed at preempt.c:36

Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
---
 xen/drivers/passthrough/pci.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Sander Eikelenboom Dec. 4, 2019, 10:06 p.m. UTC | #1
On 04/12/2019 22:31, Igor Druzhinin wrote:
> The locking responsibilities have changed and a premature break in
> this section now causes the following assertion:
> 
> Assertion '!preempt_count()' failed at preempt.c:36
> 
> Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
> Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
> ---
>  xen/drivers/passthrough/pci.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
> index ced0c28..2593fe4 100644
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -1705,6 +1705,7 @@ int iommu_do_pci_domctl(
>                         seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
>                  ret = -EINVAL;
>              }
> +            pcidevs_unlock();
>              break;
>          }
>          else if ( !ret )
> 

Just tested and it works for me, thanks Igor!

--
Sander
Jan Beulich Dec. 5, 2019, 9:08 a.m. UTC | #2
On 04.12.2019 22:31, Igor Druzhinin wrote:
> The locking responsibilities have changed and a premature break in
> this section now causes the following assertion:
> 
> Assertion '!preempt_count()' failed at preempt.c:36
> 
> Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
> Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
> ---
>  xen/drivers/passthrough/pci.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
> index ced0c28..2593fe4 100644
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -1705,6 +1705,7 @@ int iommu_do_pci_domctl(
>                         seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
>                  ret = -EINVAL;
>              }
> +            pcidevs_unlock();
>              break;

As discussed on the thread of Sander's report, I think we'd be
better off simply deleting the break statement.

Jan
diff mbox series

Patch

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index ced0c28..2593fe4 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1705,6 +1705,7 @@  int iommu_do_pci_domctl(
                        seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
                 ret = -EINVAL;
             }
+            pcidevs_unlock();
             break;
         }
         else if ( !ret )