allocate pci id for mdpy
PATCH 1/1 allocate pci id for mdpy
mdpy is a sample pci device for vfio-mdev. Not (yet) merged upstream, patch available here:
--- docs/specs/pci-ids.txt | 1 + include/hw/pci/pci.h | 1 + 2 files changed, 2 insertions(+)
docs/specs/pci-ids.txt +1 -0
@@ -62,6 +62,7 @@ PCI devices (other than virtio): 1b36:000a PCI-PCI bridge (multiseat) 1b36:000b PCIe Expander Bridge (-device pxb-pcie) 1b36:000d PCI xhci usb host adapter +1b36:000f mdpy (mdev sample device), linux/samples/vfio-mdev/mdpy.c All these devices are documented in docs/specs.
include/hw/pci/pci.h +1 -0
@@ -101,6 +101,7 @@ extern bool pci_available;#define PCI_DEVICE_ID_REDHAT_PCIE_RP 0x000c#define PCI_DEVICE_ID_REDHAT_XHCI 0x000d#define PCI_DEVICE_ID_REDHAT_PCIE_BRIDGE 0x000e +#define PCI_DEVICE_ID_REDHAT_MDPY 0x000f#define PCI_DEVICE_ID_REDHAT_QXL 0x0100#define FMT_PCIBUS PRIx64
Signature · 1 line
2.9.3
Quoted 7 lines · Gerd Hoffmann
mdpy is a sample pci device for vfio-mdev. Not (yet) merged upstream, patch available here:
Cc Alex Williamson <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>
I presume this should be merged together with the device implementation in qemu, or do you want this in tree sooner?
Quoted 31 lines
--- docs/specs/pci-ids.txt | 1 + include/hw/pci/pci.h | 1 + 2 files changed, 2 insertions(+)docs/specs/pci-ids.txt +1
-0@@ -62,6 +62,7 @@ PCI devices (other than virtio): 1b36:000a PCI-PCI bridge (multiseat) 1b36:000b PCIe Expander Bridge (-device pxb-pcie) 1b36:000d PCI xhci usb host adapter +1b36:000f mdpy (mdev sample device), linux/samples/vfio-mdev/mdpy.c All these devices are documented in docs/specs.include/hw/pci/pci.h +1
-0@@ -101,6 +101,7 @@ extern bool pci_available;#define PCI_DEVICE_ID_REDHAT_PCIE_RP 0x000c#define PCI_DEVICE_ID_REDHAT_XHCI 0x000d#define PCI_DEVICE_ID_REDHAT_PCIE_BRIDGE 0x000e +#define PCI_DEVICE_ID_REDHAT_MDPY 0x000f#define PCI_DEVICE_ID_REDHAT_QXL 0x0100#define FMT_PCIBUS PRIx64Signature · 1 line
2.9.3
Quoted 6 lines · Michael S. Tsirkin
Quoted 5 lines · Gerd Hoffmann
mdpy is a sample pci device for vfio-mdev. Not (yet) merged upstream, patch available here:
Quoted 8 lines
Quoted 2 lines
Cc Alex Williamson <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>Reviewed-by Michael S. Tsirkin <[email protected]>I presume this should be merged together with the device implementation in qemu, or do you want this in tree sooner?
There isn't a device implementation in qemu. It's a mdev device provided by the kernel. Can be used with qemu using vfio.
cheers,
Gerd
Quoted 16 lines · Gerd Hoffmann
Quoted 6 lines · Michael S. Tsirkin
Quoted 5 lines · Gerd Hoffmann
mdpy is a sample pci device for vfio-mdev. Not (yet) merged upstream, patch available here:
Quoted 8 lines
Quoted 2 lines
Cc Alex Williamson <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>Reviewed-by Michael S. Tsirkin <[email protected]>I presume this should be merged together with the device implementation in qemu, or do you want this in tree sooner?
Quoted 5 lines
There isn't a device implementation in qemu. It's a mdev device provided by the kernel. Can be used with qemu using vfio.
cheers,
Gerd
Why do we need a define in pci.h then?
Signature · 1 line
MST
Quoted 13 lines · On Thu, 26 Apr 2018 18:40:40 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 12 lines · Gerd Hoffmann
Quoted 11 lines · Michael S. Tsirkin
Quoted 7 lines · Gerd Hoffmann
mdpy is a sample pci device for vfio-mdev. Not (yet) merged upstream, patch available here:
Cc Alex Williamson <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>Reviewed-by Michael S. Tsirkin <[email protected]>
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
I presume this should be merged together with the device implementation in qemu, or do you want this in tree sooner?
There isn't a device implementation in qemu. It's a mdev device provided by the kernel. Can be used with qemu using vfio.
Why do we need a define in
pci.hthen?
Because we want to allocate the device ID rather than squat on an unused one and risk that it later conflicts with an another device. Do we track device ID allocations from the RH vendor ID other than here in QEMU? Thanks,
Alex
Quoted 23 lines · Alex Williamson
Quoted 20 lines · On Thu, 26 Apr 2018 18:40:40 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 18 lines · Gerd Hoffmann
Quoted 6 lines · Michael S. Tsirkin
Quoted 5 lines · Gerd Hoffmann
mdpy is a sample pci device for vfio-mdev. Not (yet) merged upstream, patch available here:
Quoted 8 lines
Quoted 2 lines
Cc Alex Williamson <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>Reviewed-by Michael S. Tsirkin <[email protected]>I presume this should be merged together with the device implementation in qemu, or do you want this in tree sooner?
There isn't a device implementation in qemu. It's a mdev device provided by the kernel. Can be used with qemu using vfio.
Quoted 8 lines
Quoted 1 line
Why do we need a define in
pci.hthen?Because we want to allocate the device ID rather than squat on an unused one and risk that it later conflicts with an another device. Do we track device ID allocations from the RH vendor ID other than here in QEMU? Thanks,
Alex
We have pci-ids.txt, yes. Unused macros just might get pruned down the line. If you like, add a comment in pci.h saying 0xf is reserved for mdpy.
Signature · 1 line
MST
Quoted 17 lines · Michael S. Tsirkin
Quoted 16 lines · Gerd Hoffmann
Quoted 14 lines · Michael S. Tsirkin
Quoted 7 lines · Gerd Hoffmann
mdpy is a sample pci device for vfio-mdev. Not (yet) merged upstream, patch available here:
Cc Alex Williamson <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>Reviewed-by Michael S. Tsirkin <[email protected]>I presume this should be merged together with the device implementation in qemu, or do you want this in tree sooner?
Quoted 7 lines
Quoted 5 lines
There isn't a device implementation in qemu. It's a mdev device provided by the kernel. Can be used with qemu using vfio.
cheers,
GerdWhy do we need a define in
pci.hthen?
Looks like a good way to make sure we don't hand out the ID twice as docs/specs/pci-ids.txt is not fully in sync with include/hw/pci/pci.h. 1b36:000c and 1b36:000e are missing in docs/specs/pci-ids.txt.
cheers,
Gerd