From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Thanos Makatos <thanos.makatos@nutanix.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"Martins, Joao" <joao.m.martins@oracle.com>,
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>,
Eric Auger <eric.auger@redhat.com>,
David Gibson <david@gibson.dropbear.id.au>,
"Liu, Yi L" <yi.l.liu@intel.com>
Subject: Re: iommufd dirty page logging overview
Date: Mon, 21 Mar 2022 10:30:55 -0300 [thread overview]
Message-ID: <20220321133055.GT11336@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB5276CF40E2B50782FC20275F8C159@BN9PR11MB5276.namprd11.prod.outlook.com>
On Sun, Mar 20, 2022 at 03:34:30AM +0000, Tian, Kevin wrote:
> Thinking more the real problem is not related to *before* vs. *after*
> thing. :/ If Qemu itself doesn't maintain a virtual iotlb
It has to be after because only unmap guarentees that DMA is
completely stopped.
qemu must ensure it doesn't change the user VA to GPA mapping between
unmap and device fetch dirty, or install something else into that
IOVA.
Yes the physical PFNs can be shuffled around by the kernel due to the
lost page pin, but the logical dirty is really attached to qemu's
process VA (HVA), not the physical PFN.
It has to do this in all cases regardless of device or not - when it
unmaps the IOVA it must know what HVA it put there and translate the
dirties to that bitmap.
> given guest mappings for dirtied GIOVAs in the unmapped range
> already disappear at that point thus the path to find GIOVA->GPA->HVA
> is just broken.
qemu has to keep track of how IOVAs translate to HVAs - maybe we could
have the kernel return the HVA during unmap as well, it already stores
it, but this has some complications..
Fundamentally from a qemu perspective it is translating everything to
UVA because UVA is what the live migration machinery uses.
But this is all qemu problems and doesn't really help inform the
kernel API..
Jason
next prev parent reply other threads:[~2022-03-21 13:31 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 [this message]
2022-03-22 2:40 ` Tian, Kevin
2022-03-17 12:39 ` Joao Martins
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=20220321133055.GT11336@nvidia.com \
--to=jgg@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=eric.auger@redhat.com \
--cc=joao.m.martins@oracle.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