[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB5276CC3B1773CF183E147D6B8CDB9@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Tue, 7 Feb 2023 03:36:44 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: "Liu, Yi L" <yi.l.liu@...el.com>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"jgg@...dia.com" <jgg@...dia.com>
CC: "cohuck@...hat.com" <cohuck@...hat.com>,
"eric.auger@...hat.com" <eric.auger@...hat.com>,
"nicolinc@...dia.com" <nicolinc@...dia.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"mjrosato@...ux.ibm.com" <mjrosato@...ux.ibm.com>,
"chao.p.peng@...ux.intel.com" <chao.p.peng@...ux.intel.com>,
"yi.y.sun@...ux.intel.com" <yi.y.sun@...ux.intel.com>,
"peterx@...hat.com" <peterx@...hat.com>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"shameerali.kolothum.thodi@...wei.com"
<shameerali.kolothum.thodi@...wei.com>,
"lulu@...hat.com" <lulu@...hat.com>,
"suravee.suthikulpanit@....com" <suravee.suthikulpanit@....com>,
"intel-gvt-dev@...ts.freedesktop.org"
<intel-gvt-dev@...ts.freedesktop.org>,
"intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>
Subject: RE: [PATCH v2 05/14] kvm/vfio: Accept vfio device file from userspace
> From: Liu, Yi L <yi.l.liu@...el.com>
> Sent: Monday, February 6, 2023 5:05 PM
>
> This defines KVM_DEV_VFIO_FILE* and make alias with
> KVM_DEV_VFIO_GROUP*.
> Old userspace uses KVM_DEV_VFIO_GROUP* works as well.
>
> Signed-off-by: Yi Liu <yi.l.liu@...el.com>
> ---
> Documentation/virt/kvm/devices/vfio.rst | 40 ++++++++++++++-----------
> include/uapi/linux/kvm.h | 16 +++++++---
> virt/kvm/vfio.c | 16 +++++-----
> 3 files changed, 42 insertions(+), 30 deletions(-)
>
> diff --git a/Documentation/virt/kvm/devices/vfio.rst
> b/Documentation/virt/kvm/devices/vfio.rst
> index 2d20dc561069..7f84ec26ca4a 100644
> --- a/Documentation/virt/kvm/devices/vfio.rst
> +++ b/Documentation/virt/kvm/devices/vfio.rst
> @@ -9,23 +9,26 @@ Device types supported:
> - KVM_DEV_TYPE_VFIO
>
> Only one VFIO instance may be created per VM. The created device
> -tracks VFIO groups in use by the VM and features of those groups
> -important to the correctness and acceleration of the VM. As groups
> -are enabled and disabled for use by the VM, KVM should be updated
> -about their presence. When registered with KVM, a reference to the
> -VFIO-group is held by KVM.
> +tracks VFIO files (group or device) in use by the VM and features
> +of those groups/devices important to the correctness and acceleration
> +of the VM. As groups/devices are enabled and disabled for use by the
> +VM, KVM should be updated about their presence. When registered with
> +KVM, a reference to the VFIO file is held by KVM.
>
> Groups:
"Files"
> - KVM_DEV_VFIO_GROUP
> -
> -KVM_DEV_VFIO_GROUP attributes:
> - KVM_DEV_VFIO_GROUP_ADD: Add a VFIO group to VFIO-KVM device
> tracking
> - kvm_device_attr.addr points to an int32_t file descriptor
> - for the VFIO group.
> - KVM_DEV_VFIO_GROUP_DEL: Remove a VFIO group from VFIO-KVM
> device tracking
> - kvm_device_attr.addr points to an int32_t file descriptor
> - for the VFIO group.
> - KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE: attaches a guest visible TCE
> table
> + KVM_DEV_VFIO_FILE
> + - alias: KVM_DEV_VFIO_GROUP
> +
> +KVM_DEV_VFIO_FILE attributes:
> + KVM_DEV_VFIO_FILE_ADD: Add a VFIO file (group/device) to VFIO-KVM
> device
> + tracking kvm_device_attr.addr points to an int32_t file descriptor
"... device tracking" and "kvm_device.attr.addr points to..." are two
sentences. They are deliberately arranged to be in different lines.
> + for the VFIO file.
> + - alias: KVM_DEV_VFIO_GROUP_ADD
> + KVM_DEV_VFIO_FILE_DEL: Remove a VFIO file (group/device) from VFIO-
> KVM
> + device tracking kvm_device_attr.addr points to an int32_t file
> + descriptor for the VFIO file.
ditto
> + - alias: KVM_DEV_VFIO_GROUP_DEL
> + KVM_DEV_VFIO_FILE_SET_SPAPR_TCE: attaches a guest visible TCE table
> allocated by sPAPR KVM.
somehow here it should emphasize that the file can only be group
> kvm_device_attr.addr points to a struct::
>
> @@ -36,6 +39,7 @@ KVM_DEV_VFIO_GROUP attributes:
>
> where:
>
> - - @groupfd is a file descriptor for a VFIO group;
> - - @tablefd is a file descriptor for a TCE table allocated via
> - KVM_CREATE_SPAPR_TCE.
> + *) @groupfd is a file descriptor for a VFIO group;
> + *) @tablefd is a file descriptor for a TCE table allocated via
why changing above two lines?
> + KVM_CREATE_SPAPR_TCE.
> + - alias: KVM_DEV_VFIO_FILE_SET_SPAPR_TCE
GROUP
Powered by blists - more mailing lists