public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Joao Martins <joao.m.martins@oracle.com>
To: Thanos Makatos <thanos.makatos@nutanix.com>
Cc: John Levon <john.levon@nutanix.com>,
	"john.g.johnson@oracle.com" <john.g.johnson@oracle.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	"kevin.tian@intel.com" <kevin.tian@intel.com>,
	Eric Auger <eric.auger@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	"yi.l.liu@intel.com" <yi.l.liu@intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: iommufd dirty page logging overview
Date: Thu, 17 Mar 2022 12:39:44 +0000	[thread overview]
Message-ID: <4e36607d-6339-63f0-39ef-3dbf00d9ec4d@oracle.com> (raw)
In-Reply-To: <DM8PR02MB80050C48AF03C8772EB5988F8B119@DM8PR02MB8005.namprd02.prod.outlook.com>

On 3/16/22 23:29, Thanos Makatos wrote:
> We're interested in adopting the new migration v2 interface and the new dirty
> page logging for /dev/iommufd in an out-of-process device emulation protocol
> [1]. Although it's purely userspace, we do want to stay close to the new API(s)
> being proposed for many reasons, mainly to re-use the QEMU implementation. The
> migration-related changes are relatively straightforward, I'm more interested
> in the dirty page logging. I've started reading the relevant email threads and
> my impression so far is that the details are still being decided? I don't see
> any commits related to dirty page logging in Yi's repo
> (https://github.com/luxis1999/iommufd) (at least not in the commit messages). I
> see that Joao has done some work using the existing dirty bitmaps
> (https://github.com/jpemartins/linux/commits/iommufd).

This branch here so far covers current vfio compatibility of iommufd (with an
AMD IOMMU implementation) solely because it was the easiest to start with given
the existing userspace (qemu). There's also a qemu counterpart with the emulated
AMD IOMMU implementation (should you lack the hardware). I'll be updating those branches
as things evolve i.e. once I have an initial version of the iommufd native API and more
IOMMUs support. Now, whether the vfio-compat part remains is TBD.

TBH much how we are discussing on the list -- and that Jason iterated yesterday --
I too don't expect a divergence on the API semantics from current VFIO system IOMMU
tracking. userspace-facing dirty reporting eventually gets a bitmap, with a bit
representing a <page-size>, the bitmap represents a range with a "base" iova and a <size>
(subset of a previously DMA-mapped range) that *matches* the size of the bitmap. And then
you start/stop tracking, read the dirty data and lastly DMA unmaps also fetch the dirty
data (if requested). The device-dirty tracking (via PCI) ought to model the target PF/VF
vendor interface but that is not iommufd.

The new things iommu-wise I expect are more about what the current API doesn't capture,
though, these are somewhat unrelated to the tracking control / reporting itself and more
about the IO page tables mappings i.e. changing domain's <page-size> in-place/dynamically
to increase the granularity of the dirty tracking.

[*] interestingly, arm64 SMMUv3.x seems to have an idea of 'stalling' transactions (not
sure if all kinds are supported) and letting CPU retry them as if the endpoint had just
requested ... without depending on endpoint PRI support.

> Is there a rough idea of
> how the new dirty page logging will look like? Is this already explained in the
> email threads an I missed it?
>
Granted that you came across the repo, I suppose you went through all the threads :)

      parent reply	other threads:[~2022-03-17 12:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 23:29 iommufd dirty page logging overview Thanos Makatos
2022-03-16 23:50 ` Jason Gunthorpe
2022-03-18  9:23   ` Tian, Kevin
2022-03-18 12:41     ` Jason Gunthorpe
2022-03-18 15:06       ` Alex Williamson
2022-03-18 15:55         ` Jason Gunthorpe
2022-03-19  7:54       ` Tian, Kevin
2022-03-19  8:14       ` Tian, Kevin
2022-03-20  3:34       ` Tian, Kevin
2022-03-21 13:30         ` Jason Gunthorpe
2022-03-22  2:40           ` Tian, Kevin
2022-03-17 12:39 ` Joao Martins [this message]

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=4e36607d-6339-63f0-39ef-3dbf00d9ec4d@oracle.com \
    --to=joao.m.martins@oracle.com \
    --cc=alex.williamson@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=eric.auger@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=john.g.johnson@oracle.com \
    --cc=john.levon@nutanix.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=stefanha@redhat.com \
    --cc=thanos.makatos@nutanix.com \
    --cc=yi.l.liu@intel.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