Re: [PATCH v2] docs: kvm: vfio: Require call KVM_DEV_VFIO_GROUP_ADD before VFIO_GROUP_GET_DEVICE_FD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 17 Apr 2023 13:04:50 +0000
"Liu, Yi L" <yi.l.liu@xxxxxxxxx> wrote:

> > From: Alex Williamson <alex.williamson@xxxxxxxxxx>
> > Sent: Saturday, April 15, 2023 4:08 AM
> > On Tue, 11 Apr 2023 13:28:03 -0600
> > Alex Williamson <alex.williamson@xxxxxxxxxx> wrote:
> >   
> > > On Tue, 21 Feb 2023 18:22:31 -0800
> > > Yi Liu <yi.l.liu@xxxxxxxxx> wrote:
> > >  
> > > > as some vfio_device drivers require a kvm pointer to be set in their
> > > > open_device and kvm pointer is set to VFIO in GROUP_ADD path.
> > > >
> > > > Signed-off-by: Yi Liu <yi.l.liu@xxxxxxxxx>
> > > > ---
> > > > v2:
> > > >  - Adopt Alex's suggestion
> > > > v1: https://lore.kernel.org/kvm/20230221034114.135386-1-yi.l.liu@xxxxxxxxx/
> > > > ---
> > > >  Documentation/virt/kvm/devices/vfio.rst | 7 +++++++
> > > >  1 file changed, 7 insertions(+)
> > > >
> > > > diff --git a/Documentation/virt/kvm/devices/vfio.rst  
> > b/Documentation/virt/kvm/devices/vfio.rst  
> > > > index 2d20dc561069..79b6811bb4f3 100644
> > > > --- a/Documentation/virt/kvm/devices/vfio.rst
> > > > +++ b/Documentation/virt/kvm/devices/vfio.rst
> > > > @@ -39,3 +39,10 @@ KVM_DEV_VFIO_GROUP attributes:
> > > >  	- @groupfd is a file descriptor for a VFIO group;
> > > >  	- @tablefd is a file descriptor for a TCE table allocated via
> > > >  	  KVM_CREATE_SPAPR_TCE.
> > > > +
> > > > +::
> > > > +
> > > > +The GROUP_ADD operation above should be invoked prior to accessing the
> > > > +device file descriptor via VFIO_GROUP_GET_DEVICE_FD in order to support
> > > > +drivers which require a kvm pointer to be set in their .open_device()
> > > > +callback.  
> > >
> > > I updated the title and commit log so as not to further construe that
> > > documentation can impose a requirement, otherwise applied to vfio next
> > > branch for v6.4.  Thanks,  
> > 
> > Dropped
> > 
> > https://lore.kernel.org/all/20230413163336.7ce6ecec.alex.williamson@xxxxxxxxxx/
> > 
> > Please resubmit, resolving the warning and change the title since a
> > requirement of some drivers does not equate to a requirement of the
> > API.  Thanks,  
> 
> Sorry for it. May just remove the "::". So a version as below. Please let me
> know it is ok, then I'll submit it.

Sure, so long as the docs build warning is gone.  I'll wait for a
separate v3 posting.  Thanks,

Alex

 
> From abfc87425aa2977c08511b648a194bcfb072dcb8 Mon Sep 17 00:00:00 2001
> From: Yi Liu <yi.l.liu@xxxxxxxxx>
> Date: Thu, 16 Feb 2023 02:37:28 -0800
> Subject: [PATCH] docs: kvm: vfio: Suggest KVM_DEV_VFIO_GROUP_ADD vs VFIO_GROUP_GET_DEVICE_FD ordering
> 
> as some vfio_device's open_device op requires kvm pointer and kvm pointer
> set is part of GROUP_ADD.
> 
> Signed-off-by: Yi Liu <yi.l.liu@xxxxxxxxx>
> ---
>  Documentation/virt/kvm/devices/vfio.rst | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/virt/kvm/devices/vfio.rst b/Documentation/virt/kvm/devices/vfio.rst
> index 2d20dc561069..79b6811bb4f3 100644
> --- a/Documentation/virt/kvm/devices/vfio.rst
> +++ b/Documentation/virt/kvm/devices/vfio.rst
> @@ -39,3 +39,8 @@ KVM_DEV_VFIO_GROUP attributes:
>  	- @groupfd is a file descriptor for a VFIO group;
>  	- @tablefd is a file descriptor for a TCE table allocated via
>  	  KVM_CREATE_SPAPR_TCE.
> +
> +The GROUP_ADD operation above should be invoked prior to accessing the
> +device file descriptor via VFIO_GROUP_GET_DEVICE_FD in order to support
> +drivers which require a kvm pointer to be set in their .open_device()
> +callback.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux