Messages in this thread | | | Subject | Re: [PATCH 4/5] intel-iommu: Reinstate RMRRs if a device is removed from passthrough domain | From | David Woodhouse <> | Date | Wed, 28 Oct 2009 14:36:59 +0000 |
| |
On Tue, 2009-10-27 at 09:50 -0600, Alex Williamson wrote: > On Tue, 2009-10-27 at 08:15 +0000, David Woodhouse wrote: > > On Mon, 2009-10-26 at 17:25 -0600, Alex Williamson wrote: > > > When a device is setup for passthrough it has full access to memory > > > so processing the RMRRs is unnecessary. However, if we remove the device > > > from the si_domain, we need to reinstate the associated RMRRs. > > > > > > Signed-off-by: Alex Williamson <alex.williamson@hp.com> > > > > If your device is doing DMA to host memory autonomously, you may still > > have problems with this patch -- you take it out of the si_domain and > > then there's a period of time before you reapply the RMRRs, during which > > its DMA may be prevented. > > > > You want to set up the new domain first, then switch the device over to > > it atomically. > > Yes, good point. I'm not seeing any convenient ways to setup a new > domain for a device while it's still a member of the si_domain. It > looks like I'd need to extract parts of the get_valid_domain_for_dev() > path and ignore any bits about using the already existing domain.
That seems like a sane plan. That code wants cleaning up anyway, and factoring out the 'make new domain' part of get_valid_domain_for_dev() should be simple enough.
-- dwmw2
| |