summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorLu Baolu2019-07-20 04:01:26 +0200
committerJoerg Roedel2019-08-09 17:29:25 +0200
commitbfeaec7f7d2f6b09764a1b48e88e9ca3d5076419 (patch)
tree217f85e58440fd35621d9c693cf2d977fa9e96f0 /drivers/iommu
parentiommu/vt-d: Detach domain when move device out of group (diff)
downloadkernel-qcow2-linux-bfeaec7f7d2f6b09764a1b48e88e9ca3d5076419.tar.gz
kernel-qcow2-linux-bfeaec7f7d2f6b09764a1b48e88e9ca3d5076419.tar.xz
kernel-qcow2-linux-bfeaec7f7d2f6b09764a1b48e88e9ca3d5076419.zip
iommu/vt-d: Correctly check format of page table in debugfs
PASID support and enable bit in the context entry isn't the right indicator for the type of tables (legacy or scalable mode). Check the DMA_RTADDR_SMT bit in the root context pointer instead. Cc: Ashok Raj <ashok.raj@intel.com> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> Cc: Kevin Tian <kevin.tian@intel.com> Cc: Sai Praneeth <sai.praneeth.prakhya@intel.com> Fixes: dd5142ca5d24b ("iommu/vt-d: Add debugfs support to show scalable mode DMAR table internals") Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/intel-iommu-debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/intel-iommu-debugfs.c b/drivers/iommu/intel-iommu-debugfs.c
index 2b25d9c59336..471f05d452e0 100644
--- a/drivers/iommu/intel-iommu-debugfs.c
+++ b/drivers/iommu/intel-iommu-debugfs.c
@@ -235,7 +235,7 @@ static void ctx_tbl_walk(struct seq_file *m, struct intel_iommu *iommu, u16 bus)
tbl_wlk.ctx_entry = context;
m->private = &tbl_wlk;
- if (pasid_supported(iommu) && is_pasid_enabled(context)) {
+ if (dmar_readq(iommu->reg + DMAR_RTADDR_REG) & DMA_RTADDR_SMT) {
pasid_dir_ptr = context->lo & VTD_PAGE_MASK;
pasid_dir_size = get_pasid_dir_size(context);
pasid_dir_walk(m, pasid_dir_ptr, pasid_dir_size);