lkml.org 
[lkml]   [2009]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH] intel-iommu: intel_iommu_domain_alloc should check 'dmar_disabled'

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 <bhavesh@vmware.com>
---
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


\
 
 \ /
  Last update: 2009-01-17 00:57    [W:0.061 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site