intel_iommu_domain_alloc() will try and iommu_alloc_domain(iommu),
which calls alloc_domain_mem() to allocate out of 'iommu_domain_cache'.
Unfortunately iommu_domain_cache will not be created if booted with
"intel_iommu=off", i.e. dmar_disabled = 1.
This fixes that.
Signed-off-by: Bhavesh P. Davda <[email protected]>
---
drivers/pci/intel-iommu.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 5c8baa4..06237a8 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2356,6 +2356,11 @@ struct dmar_domain *intel_iommu_domain_alloc(struct pci_dev *pdev)
struct dmar_domain *domain;
struct intel_iommu *iommu;
+ if (dmar_disabled) {
+ printk(KERN_ERR "intel_iommu_domain_alloc: Intel-IOMMU disabled\n");
+ return NULL;
+ }
+
drhd = dmar_find_matched_drhd_unit(pdev);
if (!drhd) {
printk(KERN_ERR "intel_iommu_domain_alloc: drhd == NULL\n");
--
1.5.6.3
On Fri, Jan 16, 2009 at 03:54:12PM -0800, Bhavesh Davda wrote:
>
> intel_iommu_domain_alloc() will try and iommu_alloc_domain(iommu),
> which calls alloc_domain_mem() to allocate out of 'iommu_domain_cache'.
> Unfortunately iommu_domain_cache will not be created if booted with
> "intel_iommu=off", i.e. dmar_disabled = 1.
>
Hi Bhavesh,
What's the callchain that can result in intel_iommu_domain_alloc
being called? It looks like most possible callsites are checking
intel_iommu_found, which will be 0 since we check dmar_disabled before
calling init_dmars to enumerate the iommus.
(I'm looking at 2.6.28.y right now, is there an interim between when you
stumbled upon this two weeks ago and git head where it's no longer an
issue? I guess it probably got missed due to folks travelling for LCA.)
regards, Kyle