All of lore.kernel.org
 help / color / mirror / Atom feed
* About unmap pages and set dirty tracking on nested parent domain
@ 2024-01-25 13:55 Yi Liu
  2024-01-25 14:03 ` Jason Gunthorpe
  0 siblings, 1 reply; 5+ messages in thread
From: Yi Liu @ 2024-01-25 13:55 UTC (permalink / raw)
  To: Jason Gunthorpe, Tian, Kevin
  Cc: Lu Baolu, Nicolin Chen, alex.williamson@redhat.com, Robin Murphy,
	Joerg Roedel, iommu@lists.linux.dev

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-26  9:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-25 13:55 About unmap pages and set dirty tracking on nested parent domain Yi Liu
2024-01-25 14:03 ` Jason Gunthorpe
2024-01-26  0:19   ` Jason Gunthorpe
2024-01-26  9:36     ` Yi Liu
2024-01-26  9:30   ` Yi Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.