qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Thanos Makatos <thanos.makatos@nutanix.com>
Cc: John Johnson <john.g.johnson@oracle.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	John Levon <john.levon@nutanix.com>
Subject: Re: [RFC v4 01/21] vfio-user: introduce vfio-user protocol specification
Date: Tue, 15 Mar 2022 16:28:17 -0600	[thread overview]
Message-ID: <20220315162817.3401a804.alex.williamson@redhat.com> (raw)
In-Reply-To: <DM8PR02MB8005ACC7B26833CC47F9101B8B109@DM8PR02MB8005.namprd02.prod.outlook.com>

On Tue, 15 Mar 2022 21:43:15 +0000
Thanos Makatos <thanos.makatos@nutanix.com> wrote:

> > -----Original Message-----
> > From: Qemu-devel <qemu-devel-  
> > bounces+thanos.makatos=nutanix.com@nongnu.org> On Behalf Of Alex  
> > Williamson
> > Sent: 09 March 2022 22:35
> > To: John Johnson <john.g.johnson@oracle.com>
> > Cc: qemu-devel@nongnu.org
> > Subject: Re: [RFC v4 01/21] vfio-user: introduce vfio-user protocol specification
> > 
> > On Tue, 11 Jan 2022 16:43:37 -0800
> > John Johnson <john.g.johnson@oracle.com> wrote:  
> > > +VFIO region info cap sparse mmap
> > > +""""""""""""""""""""""""""""""""
> > > +
> > > ++----------+--------+------+
> > > +| Name     | Offset | Size |
> > > ++==========+========+======+
> > > +| nr_areas | 0      | 4    |
> > > ++----------+--------+------+
> > > +| reserved | 4      | 4    |
> > > ++----------+--------+------+
> > > +| offset   | 8      | 8    |
> > > ++----------+--------+------+
> > > +| size     | 16     | 9    |
> > > ++----------+--------+------+  
> > 
> > Typo, I'm pretty sure size isn't 9 bytes.
> >   
> > > +| ...      |        |      |
> > > ++----------+--------+------+
> > > +
> > > +* *nr_areas* is the number of sparse mmap areas in the region.
> > > +* *offset* and size describe a single area that can be mapped by the client.
> > > +  There will be *nr_areas* pairs of offset and size. The offset will be added to
> > > +  the base offset given in the ``VFIO_USER_DEVICE_GET_REGION_INFO`` to  
> > form the  
> > > +  offset argument of the subsequent mmap() call.
> > > +
> > > +The VFIO sparse mmap area is defined in ``<linux/vfio.h>`` (``struct
> > > +vfio_region_info_cap_sparse_mmap``).
> > > +
> > > +VFIO region type cap header
> > > +"""""""""""""""""""""""""""
> > > +
> > > ++------------------+---------------------------+
> > > +| Name             | Value                     |
> > > ++==================+===========================+
> > > +| id               | VFIO_REGION_INFO_CAP_TYPE |
> > > ++------------------+---------------------------+
> > > +| version          | 0x1                       |
> > > ++------------------+---------------------------+
> > > +| next             | <next>                    |
> > > ++------------------+---------------------------+
> > > +| region info type | VFIO region info type     |
> > > ++------------------+---------------------------+
> > > +
> > > +This capability is defined when a region is specific to the device.
> > > +
> > > +VFIO region info type cap
> > > +"""""""""""""""""""""""""
> > > +
> > > +The VFIO region info type is defined in ``<linux/vfio.h>``
> > > +(``struct vfio_region_info_cap_type``).
> > > +
> > > ++---------+--------+------+
> > > +| Name    | Offset | Size |
> > > ++=========+========+======+
> > > +| type    | 0      | 4    |
> > > ++---------+--------+------+
> > > +| subtype | 4      | 4    |
> > > ++---------+--------+------+
> > > +
> > > +The only device-specific region type and subtype supported by vfio-user is
> > > +``VFIO_REGION_TYPE_MIGRATION`` (3) and  
> > ``VFIO_REGION_SUBTYPE_MIGRATION`` (1).
> > 
> > These should be considered deprecated from the kernel interface.  I
> > hope there are plans for vfio-user to adopt the new interface that's
> > currently available in linux-next and intended for v5.18.
> > 
> > ...  
> > > +Unused VFIO ``ioctl()`` commands
> > > +--------------------------------
> > > +
> > > +The following VFIO commands do not have an equivalent vfio-user  
> > command:  
> > > +
> > > +* ``VFIO_GET_API_VERSION``
> > > +* ``VFIO_CHECK_EXTENSION``
> > > +* ``VFIO_SET_IOMMU``
> > > +* ``VFIO_GROUP_GET_STATUS``
> > > +* ``VFIO_GROUP_SET_CONTAINER``
> > > +* ``VFIO_GROUP_UNSET_CONTAINER``
> > > +* ``VFIO_GROUP_GET_DEVICE_FD``
> > > +* ``VFIO_IOMMU_GET_INFO``
> > > +
> > > +However, once support for live migration for VFIO devices is finalized some
> > > +of the above commands may have to be handled by the client in their
> > > +corresponding vfio-user form. This will be addressed in a future protocol
> > > +version.  
> > 
> > As above, I'd go ahead and drop the migration region interface support,
> > it's being removed from the kernel.  Dirty page handling might also be
> > something you want to pull back on as we're expecting in-kernel vfio to
> > essentially deprecate its iommu backends in favor of a new shared
> > userspace iommufd interface.  We expect to have backwards compatibility
> > via that interface, but as QEMU migration support for vfio-pci devices
> > is experimental and there are desires not to consolidate dirty page
> > tracking behind the iommu interface in the new model, it's not clear if
> > the kernel will continue to expose the current dirty page tracking.
> > 
> > AIUI, we're expecting to see patches officially proposing the iommufd
> > interface in the kernel "soon".  Thanks,  
> 
> Are you referring to the "[RFC v2] /dev/iommu uAPI proposal" work (https://lkml.org/lkml/2021/7/9/89)?

There's a more recent proposal here:

https://lore.kernel.org/all/20210919063848.1476776-1-yi.l.liu@intel.com/

But I suspect based on discussions that it's evolved quite a lot since
then.  Based on various test robot reports, I gather the current
pre-release is tracking in Yi's tree here:

https://github.com/luxis1999/iommufd

Thanks,

Alex



  reply	other threads:[~2022-03-15 22:29 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12  0:43 [RFC v4 00/21] vfio-user client John Johnson
2022-01-12  0:43 ` [RFC v4 01/21] vfio-user: introduce vfio-user protocol specification John Johnson
2022-02-14 13:10   ` Thanos Makatos
2022-03-09 22:34   ` Alex Williamson
2022-03-10 10:20     ` John Levon
2022-03-14  6:04     ` John Johnson
2022-03-15 21:43     ` Thanos Makatos
2022-03-15 22:28       ` Alex Williamson [this message]
2022-07-22  6:23     ` John Johnson
2022-01-12  0:43 ` [RFC v4 02/21] vfio-user: add VFIO base abstract class John Johnson
2022-01-12  0:43 ` [RFC v4 03/21] vfio-user: add container IO ops vector John Johnson
2022-01-12  0:43 ` [RFC v4 04/21] vfio-user: add region cache John Johnson
2022-03-09 23:40   ` Alex Williamson
2022-01-12  0:43 ` [RFC v4 05/21] vfio-user: add device IO ops vector John Johnson
2022-01-12  0:43 ` [RFC v4 06/21] vfio-user: Define type vfio_user_pci_dev_info John Johnson
2022-01-12  0:43 ` [RFC v4 07/21] vfio-user: connect vfio proxy to remote server John Johnson
2022-01-12  0:43 ` [RFC v4 08/21] vfio-user: define socket receive functions John Johnson
2022-02-03 21:53   ` Thanos Makatos
2022-02-04 12:42     ` Thanos Makatos
2022-02-07  7:07       ` John Johnson
2022-02-15 13:35   ` Thanos Makatos
2022-02-15 14:50     ` Thanos Makatos
2022-02-16  2:09       ` John Johnson
2022-02-16  9:31         ` Thanos Makatos
2022-01-12  0:43 ` [RFC v4 09/21] vfio-user: define socket send functions John Johnson
2022-01-26 10:17   ` Thanos Makatos
2022-02-07  7:09     ` John Johnson
2022-01-12  0:43 ` [RFC v4 10/21] vfio-user: get device info John Johnson
2022-01-12  0:43 ` [RFC v4 11/21] vfio-user: get region info John Johnson
2022-01-12  0:43 ` [RFC v4 12/21] vfio-user: region read/write John Johnson
2022-01-26 21:57   ` Thanos Makatos
2022-01-12  0:43 ` [RFC v4 13/21] vfio-user: pci_user_realize PCI setup John Johnson
2022-01-12  0:43 ` [RFC v4 14/21] vfio-user: get and set IRQs John Johnson
2022-01-12  0:43 ` [RFC v4 15/21] vfio-user: proxy container connect/disconnect John Johnson
2022-01-12  0:43 ` [RFC v4 16/21] vfio-user: dma map/unmap operations John Johnson
2022-01-12  0:43 ` [RFC v4 17/21] vfio-user: secure DMA support John Johnson
2022-01-12  0:43 ` [RFC v4 18/21] vfio-user: dma read/write operations John Johnson
2022-01-12  0:43 ` [RFC v4 19/21] vfio-user: pci reset John Johnson
2022-01-12  0:43 ` [RFC v4 20/21] vfio-user: migration support John Johnson
2022-02-11 13:31   ` Thanos Makatos
2022-02-14 18:50     ` John Johnson
2022-02-15 14:53       ` Thanos Makatos
2022-01-12  0:43 ` [RFC v4 21/21] Only set qemu file error if saving state so the file exists John Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220315162817.3401a804.alex.williamson@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=john.g.johnson@oracle.com \
    --cc=john.levon@nutanix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thanos.makatos@nutanix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).