Skip to content

Commit 8a3b8e6

Browse files
YanfeiXujoergroedel
authored andcommitted
iommu/vt-d: Fix to flush cache of PASID directory table
Even the PCI devices don't support pasid capability, PASID table is mandatory for a PCI device in scalable mode. However flushing cache of pasid directory table for these devices are not taken after pasid table is allocated as the "size" of table is zero. Fix it by calculating the size by page order. Found this when reading the code, no real problem encountered for now. Fixes: 194b334 ("iommu/vt-d: Fix PASID directory pointer coherency") Suggested-by: Lu Baolu <[email protected]> Signed-off-by: Yanfei Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lu Baolu <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent d3aedf9 commit 8a3b8e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/intel/pasid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ int intel_pasid_alloc_table(struct device *dev)
129129
info->pasid_table = pasid_table;
130130

131131
if (!ecap_coherent(info->iommu->ecap))
132-
clflush_cache_range(pasid_table->table, size);
132+
clflush_cache_range(pasid_table->table, (1 << order) * PAGE_SIZE);
133133

134134
return 0;
135135
}

0 commit comments

Comments
 (0)