iommu/vt-d: Fix kdump boot with VT-d enabled
Joerg Roedel
maintainercover iommu/vt-d: Fix kdump boot with VT-d enabled
Hi,
booting into a crashdump kernel with Intel IOMMU enabled and configured into passthrough mode does not succeed with the current kernel. The reason is that the check for identity mappings happen before the check for deferred device attachments. That results in wrong results returned from iommu_need_mapping() and subsequently in a wrong domain-type used in __intel_map_single(). A stripped oops is in the commit-message of patch 3.
The patch-set fixes the issue and does a few code cleanups along the way. I have not yet researched the stable and fixes tags, but when the patches are fine I will add the tags before applying the patches.
Please review.
Thanks,
Joerg
Joerg Roedel (5):
iommu/vt-d: Add attach_deferred() helper
iommu/vt-d: Move deferred device attachment into helper function iommu/vt-d: Do deferred attachment in iommu_need_mapping() iommu/vt-d: Remove deferred_attach_domain() iommu/vt-d: Simplify check in identity_mapping()
drivers/iommu/intel-iommu.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-)
Signature · 6 lines
2.17.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Joerg Roedel
maintainerPATCH 1/5 iommu/vt-d: Add attach_deferred() helper
From: Joerg Roedel <[email protected]>
Implement a helper function to check whether a device's attach process is deferred.
--- drivers/iommu/intel-iommu.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/iommu/intel-iommu.c +8 -4
@@ -762,6 +762,11 @@ static int iommu_dummy(struct device *dev)return dev->archdata.iommu ==DUMMY_DEVICE_DOMAIN_INFO ; } +static bool attach_deferred (struct device *dev) +{ +return dev->archdata.iommu ==DEFER_DEVICE_DOMAIN_INFO ; +} +/** * is_downstream_to_pci_bridge - test if a device belongs to the PCI * sub-hierarchy of a candidate PCI-PCI bridge
@@ -2510,8 +2515,7 @@ struct dmar_domain *find_domain(struct device *dev) {struct device_domain_info *info; -if (unlikely (dev->archdata.iommu ==DEFER_DEVICE_DOMAIN_INFO || - dev->archdata.iommu ==DUMMY_DEVICE_DOMAIN_INFO )) +if (unlikely (attach_deferred (dev) ||iommu_dummy (dev)))return NULL ;if (dev_is_pci (dev))
@@ -2527,7 +2531,7 @@ struct dmar_domain *find_domain(struct device *dev)static struct dmar_domain *deferred_attach_domain (struct device *dev) { -if (unlikely (dev->archdata.iommu ==DEFER_DEVICE_DOMAIN_INFO )) { +if (unlikely (attach_deferred (dev))) {struct iommu_domain *domain; dev->archdata.iommu =NULL ;
@@ -6133,7 +6137,7 @@ intel_iommu_aux_get_pasid(struct iommu_domain *domain, struct device *dev)static bool intel_iommu_is_attach_deferred (struct iommu_domain *domain,struct device *dev) { -return dev->archdata.iommu ==DEFER_DEVICE_DOMAIN_INFO ; +return attach_deferred (dev); } static int
Signature · 6 lines
2.17.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH 1/5] iommu/vt-d: Add attach_deferred() helper
Quoted 6 lines · Joerg Roedel
From: Joerg Roedel <[email protected]>
Implement a helper function to check whether a device's attach process is deferred.
Signed-off-by Joerg Roedel <[email protected]>
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH 1/5] iommu/vt-d: Add attach_deferred() helper
In reply to Joerg Roedeldrivers/iommu/intel-iommu.c static int iommu_dummy(struct device *dev) · line 768
Quoted 4 lines
drivers/iommu/intel-iommu.c +4
-0+static bool attach_deferred (struct device *dev) +{ +return dev->archdata.iommu ==DEFER_DEVICE_DOMAIN_INFO ; +}
This is not a very useful helper.
drivers/iommu/intel-iommu.c struct dmar_domain *find_domain(struct device *dev) · line 2519
Quoted 12 lines
drivers/iommu/intel-iommu.c +2
-2+/** * is_downstream_to_pci_bridge - test if a device belongs to the PCI * sub-hierarchy of a candidate PCI-PCI bridge @@ -2510,8 +2515,7 @@ struct dmar_domain *find_domain(struct device *dev) {struct device_domain_info *info; -if (unlikely (dev->archdata.iommu ==DEFER_DEVICE_DOMAIN_INFO || - dev->archdata.iommu ==DUMMY_DEVICE_DOMAIN_INFO )) +if (unlikely (attach_deferred (dev) ||iommu_dummy (dev)))return NULL ;
I'd rather kill the iommu_dummy helper as well. And IIRC I have an outstanding series somewhere that does just that..
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH 1/5] iommu/vt-d: Add attach_deferred() helper
Quoted 6 lines · Christoph Hellwig
drivers/iommu/intel-iommu.c static int iommu_dummy(struct device *dev) · line 768
Quoted 4 lines
drivers/iommu/intel-iommu.c +4
-0+static bool attach_deferred (struct device *dev) +{ +return dev->archdata.iommu ==DEFER_DEVICE_DOMAIN_INFO ; +}This is not a very useful helper.
Depends on what one considers useful. I think such helpers make the code better readable, which is pretty useful to me.
Regards,
Joerg
Joerg Roedel
maintainerPATCH 2/5 iommu/vt-d: Move deferred device attachment into helper function
In reply to Joerg RoedelFrom: Joerg Roedel <[email protected]>
Move the code that does the deferred device attachment into a separate helper function.
--- drivers/iommu/intel-iommu.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/iommu/intel-iommu.c +12 -8
@@ -2529,16 +2529,20 @@ struct dmar_domain *find_domain(struct device *dev)return NULL ; } -static struct dmar_domain *deferred_attach_domain (struct device *dev) +static void do_deferred_attach (struct device *dev) { -if (unlikely (attach_deferred (dev))) { -struct iommu_domain *domain; +struct iommu_domain *domain; - dev->archdata.iommu =NULL ; - domain =iommu_get_domain_for_dev (dev); -if (domain) -intel_iommu_attach_device (domain, dev); - } + dev->archdata.iommu =NULL ; + domain =iommu_get_domain_for_dev (dev); +if (domain) +intel_iommu_attach_device (domain, dev); +} + +static struct dmar_domain *deferred_attach_domain (struct device *dev) +{ +if (unlikely (attach_deferred (dev))) +do_deferred_attach (dev);return find_domain (dev); }
Signature · 1 line
2.17.1
Re: [PATCH 2/5] iommu/vt-d: Move deferred device attachment into helper function
Quoted 6 lines · Joerg Roedel
From: Joerg Roedel <[email protected]>
Move the code that does the deferred device attachment into a separate helper function.
Signed-off-by Joerg Roedel <[email protected]>
Re: [PATCH 2/5] iommu/vt-d: Move deferred device attachment into helper function
In reply to Joerg RoedelQuoted 7 lines
drivers/iommu/intel-iommu.c +5
-0+static void do_deferred_attach (struct device *dev) { +struct iommu_domain *domain; + dev->archdata.iommu =NULL ; + domain =iommu_get_domain_for_dev (dev); +if (domain)
drivers/iommu/intel-iommu.c struct dmar_domain *find_domain(struct device *dev) · line 2548
Quoted 10 lines
drivers/iommu/intel-iommu.c +7
-0+intel_iommu_attach_device (domain, dev); +} + +static struct dmar_domain *deferred_attach_domain (struct device *dev) +{ +if (unlikely (attach_deferred (dev))) +do_deferred_attach (dev);return find_domain (dev); }
Can we start using proper sybmbol prefixes and avoid do_* names where possible?
Joerg Roedel
maintainerPATCH 3/5 iommu/vt-d: Do deferred attachment in iommu_need_mapping()
In reply to Joerg RoedelFrom: Joerg Roedel <[email protected]>
The attachment of deferred devices needs to happen before the check whether the device is identity mapped or not. Otherwise the check will return wrong results, cause warnings boot failures in kdump kernels, like
WARNING: CPU: 0 PID: 318 at ../drivers/iommu/intel-iommu.c:592 domain_get_iommu+0x61/0x70
[...] Call Trace: __intel_map_single+0x55/0x190 intel_alloc_coherent+0xac/0x110 dmam_alloc_attrs+0x50/0xa0 ahci_port_start+0xfb/0x1f0 [libahci] ata_host_start.part.39+0x104/0x1e0 [libata]
With the earlier check the kdump boot succeeds and a crashdump is written.
--- drivers/iommu/intel-iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iommu/intel-iommu.c +3 -3
@@ -2541,9 +2541,6 @@ static void do_deferred_attach(struct device *dev)static struct dmar_domain *deferred_attach_domain (struct device *dev) { -if (unlikely (attach_deferred (dev))) -do_deferred_attach (dev); -return find_domain (dev); }
@@ -3595,6 +3592,9 @@ static bool iommu_need_mapping(struct device *dev)if (iommu_dummy (dev))return false; +if (unlikely (attach_deferred (dev))) +do_deferred_attach (dev); + ret =identity_mapping (dev);if (ret) {u64 dma_mask = *dev->dma_mask;
Signature · 6 lines
2.17.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH 3/5] iommu/vt-d: Do deferred attachment in iommu_need_mapping()
Quoted 17 lines · Joerg Roedel
From: Joerg Roedel <[email protected]>
The attachment of deferred devices needs to happen before the check whether the device is identity mapped or not. Otherwise the check will return wrong results, cause warnings boot failures in kdump kernels, like
WARNING: CPU: 0 PID: 318 at ../drivers/iommu/intel-iommu.c:592 domain_get_iommu+0x61/0x70[...] Call Trace: __intel_map_single+0x55/0x190 intel_alloc_coherent+0xac/0x110 dmam_alloc_attrs+0x50/0xa0 ahci_port_start+0xfb/0x1f0 [libahci] ata_host_start.part.39+0x104/0x1e0 [libata]
Quoted 3 lines
With the earlier check the kdump boot succeeds and a crashdump is written.
Signed-off-by Joerg Roedel <[email protected]>
Re: [PATCH 3/5] iommu/vt-d: Do deferred attachment in iommu_need_mapping()
In reply to Joerg RoedelHi Joerg,
Thanks for doing this.
Quoted 29 lines · Joerg Roedel
From: Joerg Roedel <[email protected]>
The attachment of deferred devices needs to happen before the check whether the device is identity mapped or not. Otherwise the check will return wrong results, cause warnings boot failures in kdump kernels, like
WARNING: CPU: 0 PID: 318 at ../drivers/iommu/intel-iommu.c:592 domain_get_iommu+0x61/0x70[...] Call Trace: __intel_map_single+0x55/0x190 intel_alloc_coherent+0xac/0x110 dmam_alloc_attrs+0x50/0xa0 ahci_port_start+0xfb/0x1f0 [libahci] ata_host_start.part.39+0x104/0x1e0 [libata]With the earlier check the kdump boot succeeds and a crashdump is written.
Signed-off-by Joerg Roedel <[email protected]>--- drivers/iommu/intel-iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/iommu/intel-iommu.c +0
-0
drivers/iommu/intel-iommu.c static void do_deferred_attach(struct device *dev) · line 2546
Quoted 6 lines
drivers/iommu/intel-iommu.c +0
-3@@ -2541,9 +2541,6 @@ static void do_deferred_attach(struct device *dev)static struct dmar_domain *deferred_attach_domain (struct device *dev) { -if (unlikely (attach_deferred (dev))) -do_deferred_attach (dev); -
This should also be moved to the call place of deferred_attach_domain() in bounce_map_single().
bounce_map_single() assumes that devices always use DMA domain, so it doesn't call iommu_need_mapping(). We could do_deferred_attach() there manually.
Best regards,
baolu
Quoted 5 lines
drivers/iommu/intel-iommu.c +0
-0return find_domain (dev); }
drivers/iommu/intel-iommu.c static bool iommu_need_mapping(struct device *dev) · line 3600
Quoted 9 lines
drivers/iommu/intel-iommu.c +3
-0@@ -3595,6 +3592,9 @@ static bool iommu_need_mapping(struct device *dev)if (iommu_dummy (dev))return false; +if (unlikely (attach_deferred (dev))) +do_deferred_attach (dev); + ret =identity_mapping (dev);if (ret) {u64 dma_mask = *dev->dma_mask;
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Joerg Roedel
maintainerPATCH v2 3/5 iommu/vt-d: Do deferred attachment in iommu_need_mapping()
Hi Baolu,
Quoted 14 lines · Lu Baolu
drivers/iommu/intel-iommu.c static void do_deferred_attach(struct device *dev) · line 2545
Quoted 10 lines
drivers/iommu/intel-iommu.c +0
-3@@ -2541,9 +2541,6 @@ static void do_deferred_attach(struct device *dev)static struct dmar_domain *deferred_attach_domain (struct device *dev) { -if (unlikely (attach_deferred (dev))) -do_deferred_attach (dev); -This should also be moved to the call place of
deferred_attach_domain()inbounce_map_single().
Quoted 3 lines
bounce_map_single()assumes that devices always use DMA domain, so it doesn't calliommu_need_mapping(). We coulddo_deferred_attach()there manually.
Good point, thanks for your review. Updated patch below.
From 3a5b8a66d288d86ac1fd45092e7d96f842d0cccf Mon Sep 17 00:00:00 2001
From: Joerg Roedel <[email protected]>
Date: Mon, 17 Feb 2020 17:20:59 +0100
Subject: [PATCH 3/5] iommu/vt-d: Do deferred attachment in
iommu_need_mapping()
The attachment of deferred devices needs to happen before the check whether the device is identity mapped or not. Otherwise the check will return wrong results, cause warnings boot failures in kdump kernels, like
WARNING: CPU: 0 PID: 318 at ../drivers/iommu/intel-iommu.c:592 domain_get_iommu+0x61/0x70
[...] Call Trace: __intel_map_single+0x55/0x190 intel_alloc_coherent+0xac/0x110 dmam_alloc_attrs+0x50/0xa0 ahci_port_start+0xfb/0x1f0 [libahci] ata_host_start.part.39+0x104/0x1e0 [libata]
With the earlier check the kdump boot succeeds and a crashdump is written.
--- drivers/iommu/intel-iommu.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/iommu/intel-iommu.c +7 -3
@@ -2541,9 +2541,6 @@ static void do_deferred_attach(struct device *dev)static struct dmar_domain *deferred_attach_domain (struct device *dev) { -if (unlikely (attach_deferred (dev))) -do_deferred_attach (dev); -return find_domain (dev); }
@@ -3595,6 +3592,9 @@ static bool iommu_need_mapping(struct device *dev)if (iommu_dummy (dev))return false; +if (unlikely (attach_deferred (dev))) +do_deferred_attach (dev); + ret =identity_mapping (dev);if (ret) {u64 dma_mask = *dev->dma_mask;
@@ -3958,7 +3958,11 @@ bounce_map_single(struct device *dev, phys_addr_t paddr, size_t size,int prot =0 ;int ret; +if (unlikely (attach_deferred (dev))) +do_deferred_attach (dev); + domain =deferred_attach_domain (dev); +if (WARN_ON (dir ==DMA_NONE || !domain))return DMA_MAPPING_ERROR ;
Signature · 1 line
2.25.0
Re: [PATCH 3/5 v2] iommu/vt-d: Do deferred attachment in iommu_need_mapping()
Hi Joerg,
Quoted 17 lines · Joerg Roedel
Hi Baolu,
Quoted 14 lines · Lu Baolu
drivers/iommu/intel-iommu.c static void do_deferred_attach(struct device *dev) · line 2545
Quoted 10 lines
drivers/iommu/intel-iommu.c +0
-3@@ -2541,9 +2541,6 @@ static void do_deferred_attach(struct device *dev)static struct dmar_domain *deferred_attach_domain (struct device *dev) { -if (unlikely (attach_deferred (dev))) -do_deferred_attach (dev); -This should also be moved to the call place of
deferred_attach_domain()inbounce_map_single().
Quoted 6 lines
Quoted 3 lines
bounce_map_single()assumes that devices always use DMA domain, so it doesn't calliommu_need_mapping(). We coulddo_deferred_attach()there manually.Good point, thanks for your review. Updated patch below.
Looks good to me now. For all patches in this series,
Best regards,
baolu
Quoted 65 lines
From
3a5b8a66d288d86ac1fd45092e7d96f842d0cccfMon Sep 17 00:00:00 2001
From: Joerg Roedel <[email protected]>
Date: Mon, 17 Feb 2020 17:20:59 +0100
Subject: [PATCH 3/5] iommu/vt-d: Do deferred attachment in
iommu_need_mapping()The attachment of deferred devices needs to happen before the check whether the device is identity mapped or not. Otherwise the check will return wrong results, cause warnings boot failures in kdump kernels, like
WARNING: CPU: 0 PID: 318 at ../drivers/iommu/intel-iommu.c:592 domain_get_iommu+0x61/0x70[...] Call Trace: __intel_map_single+0x55/0x190 intel_alloc_coherent+0xac/0x110 dmam_alloc_attrs+0x50/0xa0 ahci_port_start+0xfb/0x1f0 [libahci] ata_host_start.part.39+0x104/0x1e0 [libata]With the earlier check the kdump boot succeeds and a crashdump is written.
Signed-off-by Joerg Roedel <[email protected]>--- drivers/iommu/intel-iommu.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/iommu/intel-iommu.c +7
-3@@ -2541,9 +2541,6 @@ static void do_deferred_attach(struct device *dev)static struct dmar_domain *deferred_attach_domain (struct device *dev) { -if (unlikely (attach_deferred (dev))) -do_deferred_attach (dev); -return find_domain (dev); }@@ -3595,6 +3592,9 @@ static bool iommu_need_mapping(struct device *dev)if (iommu_dummy (dev))return false; +if (unlikely (attach_deferred (dev))) +do_deferred_attach (dev); + ret =identity_mapping (dev);if (ret) {u64 dma_mask = *dev->dma_mask;@@ -3958,7 +3958,11 @@ bounce_map_single(struct device *dev, phys_addr_t paddr, size_t size,int prot =0 ;int ret; +if (unlikely (attach_deferred (dev))) +do_deferred_attach (dev); + domain =deferred_attach_domain (dev); +if (WARN_ON (dir ==DMA_NONE || !domain))return DMA_MAPPING_ERROR ;
Joerg Roedel
maintainerRe: [PATCH 3/5 v2] iommu/vt-d: Do deferred attachment in iommu_need_mapping()
Quoted 3 lines · Lu Baolu
Looks good to me now. For all patches in this series,
Acked-by Lu Baolu <[email protected]>
Thanks, queued the fixes for v5.6.
Re: [PATCH 3/5 v2] iommu/vt-d: Do deferred attachment in iommu_need_mapping()
In reply to Joerg RoedelQuoted 44 lines · Joerg Roedel
Hi Baolu,
Quoted 14 lines · Lu Baolu
drivers/iommu/intel-iommu.c static void do_deferred_attach(struct device *dev) · line 2545
Quoted 10 lines
drivers/iommu/intel-iommu.c +0
-3@@ -2541,9 +2541,6 @@ static void do_deferred_attach(struct device *dev)static struct dmar_domain *deferred_attach_domain (struct device *dev) { -if (unlikely (attach_deferred (dev))) -do_deferred_attach (dev); -This should also be moved to the call place of
deferred_attach_domain()inbounce_map_single().Quoted 3 lines
bounce_map_single()assumes that devices always use DMA domain, so it doesn't calliommu_need_mapping(). We coulddo_deferred_attach()there manually.Good point, thanks for your review. Updated patch below.
From
3a5b8a66d288d86ac1fd45092e7d96f842d0cccfMon Sep 17 00:00:00 2001
From: Joerg Roedel <[email protected]>
Date: Mon, 17 Feb 2020 17:20:59 +0100
Subject: [PATCH 3/5] iommu/vt-d: Do deferred attachment iniommu_need_mapping()The attachment of deferred devices needs to happen before the check whether the device is identity mapped or not. Otherwise the check will return wrong results, cause warnings boot failures in kdump kernels, like
WARNING: CPU: 0 PID: 318 at ../drivers/iommu/intel-iommu.c:592 domain_get_iommu+0x61/0x70[...] Call Trace: __intel_map_single+0x55/0x190 intel_alloc_coherent+0xac/0x110 dmam_alloc_attrs+0x50/0xa0 ahci_port_start+0xfb/0x1f0 [libahci] ata_host_start.part.39+0x104/0x1e0 [libata]
Quoted 3 lines
With the earlier check the kdump boot succeeds and a crashdump is written.
Signed-off-by Joerg Roedel <[email protected]>
Joerg Roedel
maintainerPATCH 4/5 iommu/vt-d: Remove deferred_attach_domain()
In reply to Joerg RoedelFrom: Joerg Roedel <[email protected]>
The function is now only a wrapper around find_domain(). Remove the function and call find_domain() directly at the call-sites.
--- drivers/iommu/intel-iommu.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/iommu/intel-iommu.c +3 -8
@@ -2539,11 +2539,6 @@ static void do_deferred_attach(struct device *dev)intel_iommu_attach_device (domain, dev); } -static struct dmar_domain *deferred_attach_domain (struct device *dev) -{ -return find_domain (dev); -} -static inline struct device_domain_info *dmar_search_domain_by_dev_info (int segment,int bus,int devfn) {
@@ -3643,7 +3638,7 @@ static dma_addr_t __intel_map_single(struct device *dev, phys_addr_t paddr,BUG_ON (dir ==DMA_NONE ); - domain =deferred_attach_domain (dev); + domain =find_domain (dev);if (!domain)return DMA_MAPPING_ERROR ;
@@ -3863,7 +3858,7 @@ static int intel_map_sg(struct device *dev, struct scatterlist *sglist, int neleif (!iommu_need_mapping (dev))return dma_direct_map_sg (dev, sglist, nelems, dir, attrs); - domain =deferred_attach_domain (dev); + domain =find_domain (dev);if (!domain)return 0 ;
@@ -3958,7 +3953,7 @@ bounce_map_single(struct device *dev, phys_addr_t paddr, size_t size,int prot =0 ;int ret; - domain =deferred_attach_domain (dev); + domain =find_domain (dev);if (WARN_ON (dir ==DMA_NONE || !domain))return DMA_MAPPING_ERROR ;
Signature · 6 lines
2.17.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH 4/5] iommu/vt-d: Remove deferred_attach_domain()
Quoted 6 lines · Joerg Roedel
From: Joerg Roedel <[email protected]>
The function is now only a wrapper around
find_domain(). Remove the function and callfind_domain()directly at the call-sites.Signed-off-by Joerg Roedel <[email protected]>
Joerg Roedel
maintainerPATCH 5/5 iommu/vt-d: Simplify check in identity_mapping()
In reply to Joerg RoedelFrom: Joerg Roedel <[email protected]>
The function only has one call-site and there it is never called with dummy or deferred devices. Simplify the check in the function to account for that.
--- drivers/iommu/intel-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/intel-iommu.c +1 -1
@@ -2916,7 +2916,7 @@ static int identity_mapping(struct device *dev)struct device_domain_info *info; info = dev->archdata.iommu; -if (info && info !=DUMMY_DEVICE_DOMAIN_INFO && info !=DEFER_DEVICE_DOMAIN_INFO ) +if (info)return (info->domain == si_domain);return 0 ;
Signature · 1 line
2.17.1
Re: [PATCH 5/5] iommu/vt-d: Simplify check in identity_mapping()
Quoted 7 lines · Joerg Roedel
From: Joerg Roedel <[email protected]>
The function only has one call-site and there it is never called with dummy or deferred devices. Simplify the check in the function to account for that.
Signed-off-by Joerg Roedel <[email protected]>