Linux IOMMU Development
 help / color / mirror / Atom feed
From: Yi Liu <yi.l.liu@intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>, "Tian, Kevin" <kevin.tian@intel.com>
Cc: Lu Baolu <baolu.lu@linux.intel.com>,
	Nicolin Chen <nicolinc@nvidia.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Joerg Roedel <joro@8bytes.org>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>
Subject: About unmap pages and set dirty tracking on nested parent domain
Date: Thu, 25 Jan 2024 21:55:46 +0800	[thread overview]
Message-ID: <92f8aaca-093d-4161-b8f2-5ab1680df769@intel.com> (raw)

Hi Jason, Kevin,

Today, Intel iommu driver only tracks attached devices/iommus in the nested
domain. While the nested parent domain does not. This makes cache flush on
nested parent domain be a nop if it's only used as parent. It is an issue
if there is unmap on nested parent domain. Also, the dirty page tracking
would not take effect as well for such a nested parent domain. I plan to
fix this gap by tracking stage-1 domains in the nested parent domain within
intel iommu driver. So that iommu driver can loop the nested domains and
the devices attached on it to flush caches. However, I'd like to check with
you first before taking action.

1) Do we want to allow unmap pages on nested parent domain? Today there is
    no PRQ support on the nested parent domain (stage-2). That's why both
    VFIO and IOMMUFD pins the page in the DMA_MAP. As a result, VMMs like
    Qemu cannot not unamp pages in nested parent domain after VM is running.
    Otherwise, there will be DMA translation faults. However, there is no
    architecture limitation to support PRQ for stage-2. If PRQ is supported,
    there may be unmap on nested parent.
2) If answer of 1) is yes. Should the owner of stage-1 be notified about
    the unmap event on its nested parent, hence owner is able to flush the
    corresponding stage-1 cache explicitly? For VT-d, no such requirement as
    intel iommu driver can flush the related stage-1 cache as well when
    flushing the stage-2 cache in nested translation mode. Not sure about
    other vendors.
3) Is it enough to fix this gap within iommu driver? or need to be handled
    in the generic layer? e.g. let the iommufd layer to track stage-1 hwpts
    in stage-2 hwpt. In this way, iommufd can flush stage-1 cache when
    unmapping pages on stage-2.


Regards,
Yi Liu

             reply	other threads:[~2024-01-25 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 13:55 Yi Liu [this message]
2024-01-25 14:03 ` About unmap pages and set dirty tracking on nested parent domain Jason Gunthorpe
2024-01-26  0:19   ` Jason Gunthorpe
2024-01-26  9:36     ` Yi Liu
2024-01-26  9:30   ` Yi Liu

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=92f8aaca-093d-4161-b8f2-5ab1680df769@intel.com \
    --to=yi.l.liu@intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.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