diff options
author | Ashok Raj <ashok.raj@intel.com> | 2017-08-08 13:29:28 -0700 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2017-08-30 17:48:18 +0200 |
commit | 11b93ebfa03e1cf45d9ad508eaf2c4d3547e06ca (patch) | |
tree | 17e1e367013c49a5a5304fb32a72535e7eaf3dbf /drivers/iommu/intel-iommu.c | |
parent | 9d8c3af31607819a61011d746e861b8096ac9761 (diff) | |
download | op-kernel-dev-11b93ebfa03e1cf45d9ad508eaf2c4d3547e06ca.zip op-kernel-dev-11b93ebfa03e1cf45d9ad508eaf2c4d3547e06ca.tar.gz |
iommu/vt-d: Avoid calling virt_to_phys() on null pointer
New kernels with debug show panic() from __phys_addr() checks. Avoid
calling virt_to_phys() when pasid_state_tbl pointer is null
To: Joerg Roedel <joro@8bytes.org>
To: linux-kernel@vger.kernel.org>
Cc: iommu@lists.linux-foundation.org
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Jacob Pan <jacob.jun.pan@intel.com>
Cc: Ashok Raj <ashok.raj@intel.com>
Fixes: 2f26e0a9c9860 ('iommu/vt-d: Add basic SVM PASID support')
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Acked-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r-- | drivers/iommu/intel-iommu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index bffc880f..695f54a 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -5349,7 +5349,8 @@ int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct intel_svm_dev *sd sdev->sid = PCI_DEVID(info->bus, info->devfn); if (!(ctx_lo & CONTEXT_PASIDE)) { - context[1].hi = (u64)virt_to_phys(iommu->pasid_state_table); + if (iommu->pasid_state_table) + context[1].hi = (u64)virt_to_phys(iommu->pasid_state_table); context[1].lo = (u64)virt_to_phys(iommu->pasid_table) | intel_iommu_get_pts(iommu); |