Skip to contentSkip to conversation

Is it must for vfio-mdev parent driver to implement a pci-compliant configuration r/w interface

Question Wu Zongyong 2 participants 2 messages Dec 26, 2023 – Jan 2, 2024 PCI

lore
Share & tools
lore
#0 lore raw

Hi,

For vfio, I know there are two method to get region size:
1. VFIO_DEVICE_GET_REGION_INFO ioctl
2. write a value of all 1's to the bar register of vfio-device fd and then read the value back which is described in pci spec

Now I am curious about is it a must for a vfio-mdev parent driver to implement the method 2? Or it is just a optional interface.

Thanks,
Wu Zongyong

#1 lore raw
Quoted 9 lines · On Tue, 26 Dec 2023 10:30:04 +0800 Wu Zongyong <[email protected]>…

Hi,

For vfio, I know there are two method to get region size:
1. VFIO_DEVICE_GET_REGION_INFO ioctl
2. write a value of all 1's to the bar register of vfio-device fd and then read the value back which is described in pci spec

Now I am curious about is it a must for a vfio-mdev parent driver to implement the method 2? Or it is just a optional interface.

If there's not a working, compliant config space, the device shouldn't claim to implement a vfio-pci interface. There's vfio-platform available for non-PCI devices. While the BAR size may be found via either REGION_INFO or config space itself, the BAR address space is only found via config space, ie. memory or IO, 32 or 64-bit, prefetchable or not. Thanks,

Alex