Re: [PATCH] iommu: Implement deferred domain attachment

2020-05-19 Thread Jerry Snitselaar
On Mon May 18 20, Joerg Roedel wrote: On Fri, May 15, 2020 at 08:23:13PM +0100, Robin Murphy wrote: But that's not what this is; this is (supposed to be) the exact same "don't actually perform the attach yet" logic as before, just restricting it to default domains in the one place that it actual

Re: [PATCH] iommu: Implement deferred domain attachment

2020-05-18 Thread Jerry Snitselaar
On Mon May 18 20, Joerg Roedel wrote: On Fri, May 15, 2020 at 08:23:13PM +0100, Robin Murphy wrote: But that's not what this is; this is (supposed to be) the exact same "don't actually perform the attach yet" logic as before, just restricting it to default domains in the one place that it actual

Re: [PATCH] iommu: Implement deferred domain attachment

2020-05-18 Thread Joerg Roedel
On Fri, May 15, 2020 at 08:23:13PM +0100, Robin Murphy wrote: > But that's not what this is; this is (supposed to be) the exact same "don't > actually perform the attach yet" logic as before, just restricting it to > default domains in the one place that it actually needs to be, so as not to > fund

Re: [PATCH] iommu: Implement deferred domain attachment

2020-05-15 Thread Robin Murphy
On 2020-05-15 19:26, Joerg Roedel wrote: On Fri, May 15, 2020 at 05:28:53PM +0100, Robin Murphy wrote: On 2020-05-15 17:14, Joerg Roedel wrote: diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index ba128d1cdaee..403fda04ea98 100644 --- a/drivers/iommu/dma-iommu.c +++ b/driver

Re: [PATCH] iommu: Implement deferred domain attachment

2020-05-15 Thread Joerg Roedel
On Fri, May 15, 2020 at 05:28:53PM +0100, Robin Murphy wrote: > On 2020-05-15 17:14, Joerg Roedel wrote: > > diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c > > index ba128d1cdaee..403fda04ea98 100644 > > --- a/drivers/iommu/dma-iommu.c > > +++ b/drivers/iommu/dma-iommu.c > > @@

Re: [PATCH] iommu: Implement deferred domain attachment

2020-05-15 Thread Robin Murphy
On 2020-05-15 17:14, Joerg Roedel wrote: On Fri, May 15, 2020 at 04:42:23PM +0100, Robin Murphy wrote: struct iommu_domain *iommu_get_dma_domain(struct device *dev) { - return dev->iommu_group->default_domain; + struct iommu_domain *domain = dev->iommu_group->default_domain; +

Re: [PATCH] iommu: Implement deferred domain attachment

2020-05-15 Thread Joerg Roedel
On Fri, May 15, 2020 at 04:42:23PM +0100, Robin Murphy wrote: > > struct iommu_domain *iommu_get_dma_domain(struct device *dev) > > { > > - return dev->iommu_group->default_domain; > > + struct iommu_domain *domain = dev->iommu_group->default_domain; > > + > > + if (__iommu_is_attach_defe

Re: [PATCH] iommu: Implement deferred domain attachment

2020-05-15 Thread Robin Murphy
On 2020-05-15 10:45, Joerg Roedel wrote: From: Joerg Roedel The IOMMU core code has support for deferring the attachment of a domain to a device. This is needed in kdump kernels where the new domain must not be attached to a device before the device driver takes it over. But this needs support

Re: [PATCH] iommu: Implement deferred domain attachment

2020-05-15 Thread Joerg Roedel
On Fri, May 15, 2020 at 09:51:03PM +0800, Lu Baolu wrote: > On 2020/5/15 17:45, Joerg Roedel wrote: > > struct iommu_domain *iommu_get_dma_domain(struct device *dev) > > { > > - return dev->iommu_group->default_domain; > > + struct iommu_domain *domain = dev->iommu_group->default_domain; >

Re: [PATCH] iommu: Implement deferred domain attachment

2020-05-15 Thread Lu Baolu
Hi Joerg, On 2020/5/15 17:45, Joerg Roedel wrote: From: Joerg Roedel The IOMMU core code has support for deferring the attachment of a domain to a device. This is needed in kdump kernels where the new domain must not be attached to a device before the device driver takes it over. But this nee

[PATCH] iommu: Implement deferred domain attachment

2020-05-15 Thread Joerg Roedel
From: Joerg Roedel The IOMMU core code has support for deferring the attachment of a domain to a device. This is needed in kdump kernels where the new domain must not be attached to a device before the device driver takes it over. But this needs support from the dma-ops code too, to actually do