All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] docs: kvm: vfio: Suggest KVM_DEV_VFIO_GROUP_ADD vs VFIO_GROUP_GET_DEVICE_FD ordering
@ 2023-04-21  5:36 Yi Liu
  2023-04-21 13:44 ` Jason Gunthorpe
  2023-04-21 20:42 ` Alex Williamson
  0 siblings, 2 replies; 3+ messages in thread
From: Yi Liu @ 2023-04-21  5:36 UTC (permalink / raw)
  To: alex.williamson, kevin.tian
  Cc: jgg, cohuck, eric.auger, nicolinc, kvm, yi.l.liu, mjrosato, chao.p.peng

as some vfio_device's open_device op requires kvm pointer and kvm pointer
set is part of GROUP_ADD.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
---
v3:
 - Add r-b from Kevin
 - Remove "::" to fix "WARNING: Literal block expected; none found."
   "make htmldocs" looks good.
 - Rename the subject per Alex's suggestion

v2: https://lore.kernel.org/kvm/20230222022231.266381-1-yi.l.liu@intel.com/
 - Adopt Alex's suggestion

v1: https://lore.kernel.org/kvm/20230221034114.135386-1-yi.l.liu@intel.com/
---
 Documentation/virt/kvm/devices/vfio.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/virt/kvm/devices/vfio.rst b/Documentation/virt/kvm/devices/vfio.rst
index 2d20dc561069..08b544212638 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.
-- 
2.34.1


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

* Re: [PATCH v3] docs: kvm: vfio: Suggest KVM_DEV_VFIO_GROUP_ADD vs VFIO_GROUP_GET_DEVICE_FD ordering
  2023-04-21  5:36 [PATCH v3] docs: kvm: vfio: Suggest KVM_DEV_VFIO_GROUP_ADD vs VFIO_GROUP_GET_DEVICE_FD ordering Yi Liu
@ 2023-04-21 13:44 ` Jason Gunthorpe
  2023-04-21 20:42 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2023-04-21 13:44 UTC (permalink / raw)
  To: Yi Liu
  Cc: alex.williamson, kevin.tian, cohuck, eric.auger, nicolinc, kvm,
	mjrosato, chao.p.peng

On Thu, Apr 20, 2023 at 10:36:11PM -0700, Yi Liu wrote:
> as some vfio_device's open_device op requires kvm pointer and kvm pointer
> set is part of GROUP_ADD.
> 
> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
> Signed-off-by: Yi Liu <yi.l.liu@intel.com>
> ---
> v3:
>  - Add r-b from Kevin
>  - Remove "::" to fix "WARNING: Literal block expected; none found."
>    "make htmldocs" looks good.
>  - Rename the subject per Alex's suggestion
> 
> v2: https://lore.kernel.org/kvm/20230222022231.266381-1-yi.l.liu@intel.com/
>  - Adopt Alex's suggestion
> 
> v1: https://lore.kernel.org/kvm/20230221034114.135386-1-yi.l.liu@intel.com/
> ---
>  Documentation/virt/kvm/devices/vfio.rst | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

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

* Re: [PATCH v3] docs: kvm: vfio: Suggest KVM_DEV_VFIO_GROUP_ADD vs VFIO_GROUP_GET_DEVICE_FD ordering
  2023-04-21  5:36 [PATCH v3] docs: kvm: vfio: Suggest KVM_DEV_VFIO_GROUP_ADD vs VFIO_GROUP_GET_DEVICE_FD ordering Yi Liu
  2023-04-21 13:44 ` Jason Gunthorpe
@ 2023-04-21 20:42 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2023-04-21 20:42 UTC (permalink / raw)
  To: Yi Liu
  Cc: kevin.tian, jgg, cohuck, eric.auger, nicolinc, kvm, mjrosato,
	chao.p.peng

On Thu, 20 Apr 2023 22:36:11 -0700
Yi Liu <yi.l.liu@intel.com> wrote:

> as some vfio_device's open_device op requires kvm pointer and kvm pointer
> set is part of GROUP_ADD.
> 
> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
> Signed-off-by: Yi Liu <yi.l.liu@intel.com>
> ---
> v3:
>  - Add r-b from Kevin
>  - Remove "::" to fix "WARNING: Literal block expected; none found."
>    "make htmldocs" looks good.
>  - Rename the subject per Alex's suggestion
> 
> v2: https://lore.kernel.org/kvm/20230222022231.266381-1-yi.l.liu@intel.com/
>  - Adopt Alex's suggestion
> 
> v1: https://lore.kernel.org/kvm/20230221034114.135386-1-yi.l.liu@intel.com/
> ---
>  Documentation/virt/kvm/devices/vfio.rst | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/virt/kvm/devices/vfio.rst b/Documentation/virt/kvm/devices/vfio.rst
> index 2d20dc561069..08b544212638 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.

Applied to vfio next branch for v6.4.  Thanks,

Alex


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

end of thread, other threads:[~2023-04-21 20:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-21  5:36 [PATCH v3] docs: kvm: vfio: Suggest KVM_DEV_VFIO_GROUP_ADD vs VFIO_GROUP_GET_DEVICE_FD ordering Yi Liu
2023-04-21 13:44 ` Jason Gunthorpe
2023-04-21 20:42 ` Alex Williamson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.