Re: [PATCH v5 1/3] x86/msi: harden stale pdev handling

2024-10-17 Thread Stewart Hildebrand
On 10/15/24 02:58, Jan Beulich wrote: > On 11.10.2024 17:27, Stewart Hildebrand wrote: >> --- a/xen/arch/x86/msi.c >> +++ b/xen/arch/x86/msi.c >> @@ -1243,7 +1243,12 @@ int pci_reset_msix_state(struct pci_dev *pdev) >> { >> unsigned int pos = pci_find_cap_offset(pdev->sbdf, PCI_CAP_ID_MSIX);

Re: [PATCH v5 1/3] x86/msi: harden stale pdev handling

2024-10-14 Thread Jan Beulich
On 11.10.2024 17:27, Stewart Hildebrand wrote: > --- a/xen/arch/x86/msi.c > +++ b/xen/arch/x86/msi.c > @@ -1243,7 +1243,12 @@ int pci_reset_msix_state(struct pci_dev *pdev) > { > unsigned int pos = pci_find_cap_offset(pdev->sbdf, PCI_CAP_ID_MSIX); > > -ASSERT(pos); > +if ( !pos ) >

[PATCH v5 1/3] x86/msi: harden stale pdev handling

2024-10-11 Thread Stewart Hildebrand
Dom0 normally informs Xen of PCI device removal via PHYSDEVOP_pci_device_remove, e.g. in response to SR-IOV disable or hot-unplug. We might find ourselves with stale pdevs if a buggy dom0 fails to report removal via PHYSDEVOP_pci_device_remove. In this case, attempts to access the config space of t