Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11b93ebf authored by Ashok Raj's avatar Ashok Raj Committed by Joerg Roedel
Browse files

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: 2f26e0a9 ('iommu/vt-d: Add basic SVM PASID support')
Signed-off-by: default avatarAshok Raj <ashok.raj@intel.com>
Acked-by: default avatarDavid Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 9d8c3af3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5349,6 +5349,7 @@ 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)) {
		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);