mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [Question] Is it must for vfio-mdev parent driver to implement a pci-compliant configuration r/w interface
@ 2023-12-26  2:30 Wu Zongyong
  2024-01-02 19:28 ` Alex Williamson
  0 siblings, 1 reply; 2+ messages in thread
From: Wu Zongyong @ 2023-12-26  2:30 UTC (permalink / raw)
  To: alex.williamson; +Cc: linux-pci, linux-kernel, wutu.xq2

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Question] Is it must for vfio-mdev parent driver to implement a pci-compliant configuration r/w interface
  2023-12-26  2:30 [Question] Is it must for vfio-mdev parent driver to implement a pci-compliant configuration r/w interface Wu Zongyong
@ 2024-01-02 19:28 ` Alex Williamson
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Williamson @ 2024-01-02 19:28 UTC (permalink / raw)
  To: Wu Zongyong; +Cc: linux-pci, linux-kernel, wutu.xq2

On Tue, 26 Dec 2023 10:30:04 +0800
Wu Zongyong <wuzongyong@linux.alibaba.com> wrote:

> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-02 19:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-26  2:30 [Question] Is it must for vfio-mdev parent driver to implement a pci-compliant configuration r/w interface Wu Zongyong
2024-01-02 19:28 ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®