Re: [PATCH v2] vfio/pci: Verify each MSI vector to avoid invalid MSI vectors

2022-11-28 Thread Jason Gunthorpe
On Sat, Nov 26, 2022 at 11:15:14AM +, Marc Zyngier wrote: > > Physical hardware doesn't do this, virtual emulation shouldn't either. > > If you want to fix VFIO, be my guest. My rambling about the sorry > state of this has been in the kernel for 5 years (ed8703a506a8). We are talking about t

Re: [PATCH v2] vfio/pci: Verify each MSI vector to avoid invalid MSI vectors

2022-11-26 Thread Marc Zyngier
On Sat, 26 Nov 2022 06:33:15 +, "chenxiang (M)" wrote: > > > 在 2022/11/23 20:08, Marc Zyngier 写道: > > On Wed, 23 Nov 2022 01:42:36 +, > > chenxiang wrote: > >> From: Xiang Chen > >> > >> Currently the number of MSI vectors comes from register PCI_MSI_FLAGS > >> which should be power-o

Re: [PATCH v2] vfio/pci: Verify each MSI vector to avoid invalid MSI vectors

2022-11-25 Thread chenxiang (M)
在 2022/11/23 20:08, Marc Zyngier 写道: On Wed, 23 Nov 2022 01:42:36 +, chenxiang wrote: From: Xiang Chen Currently the number of MSI vectors comes from register PCI_MSI_FLAGS which should be power-of-2 in qemu, in some scenaries it is not the same as the number that driver requires in gue

Re: [PATCH v2] vfio/pci: Verify each MSI vector to avoid invalid MSI vectors

2022-11-24 Thread Jason Gunthorpe
On Wed, Nov 23, 2022 at 09:42:36AM +0800, chenxiang via wrote: > From: Xiang Chen > > Currently the number of MSI vectors comes from register PCI_MSI_FLAGS > which should be power-of-2 in qemu, in some scenaries it is not the same as > the number that driver requires in guest, for example, a PCI

Re: [PATCH v2] vfio/pci: Verify each MSI vector to avoid invalid MSI vectors

2022-11-24 Thread Marc Zyngier
On Wed, 23 Nov 2022 19:55:14 +, Alex Williamson wrote: > > On Wed, 23 Nov 2022 12:08:05 + > Marc Zyngier wrote: > > > On Wed, 23 Nov 2022 01:42:36 +, > > chenxiang wrote: > > > > > > +static int vfio_pci_verify_msi_entry(struct vfio_pci_core_device *vdev, > > > + struct ev

Re: [PATCH v2] vfio/pci: Verify each MSI vector to avoid invalid MSI vectors

2022-11-23 Thread Alex Williamson
On Wed, 23 Nov 2022 12:08:05 + Marc Zyngier wrote: > On Wed, 23 Nov 2022 01:42:36 +, > chenxiang wrote: > > > > From: Xiang Chen > > > > Currently the number of MSI vectors comes from register PCI_MSI_FLAGS > > which should be power-of-2 in qemu, in some scenaries it is not the same a

Re: [PATCH v2] vfio/pci: Verify each MSI vector to avoid invalid MSI vectors

2022-11-23 Thread Marc Zyngier
On Wed, 23 Nov 2022 01:42:36 +, chenxiang wrote: > > From: Xiang Chen > > Currently the number of MSI vectors comes from register PCI_MSI_FLAGS > which should be power-of-2 in qemu, in some scenaries it is not the same as > the number that driver requires in guest, for example, a PCI driver

[PATCH v2] vfio/pci: Verify each MSI vector to avoid invalid MSI vectors

2022-11-22 Thread chenxiang via
From: Xiang Chen Currently the number of MSI vectors comes from register PCI_MSI_FLAGS which should be power-of-2 in qemu, in some scenaries it is not the same as the number that driver requires in guest, for example, a PCI driver wants to allocate 6 MSI vecotrs in guest, but as the limitation, i