linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/vt-d: Fix the size calculation of pasid table
@ 2016-09-12  2:49 Xunlei Pang
  2016-09-19 12:18 ` Joerg Roedel
  0 siblings, 1 reply; 8+ messages in thread
From: Xunlei Pang @ 2016-09-12  2:49 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: iommu, linux-kernel, Xunlei Pang

According to the vt-d spec, the size of pasid (state) entry is 8B
which equals 3 in power of 2, the number of pasid (state) entries
is (ecap_pss + 1) in power of 2.

Thus the right size of pasid (state) table in power of 2 should be
ecap_pss(iommu->ecap) plus "1+3=4" other than 7.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
---
 drivers/iommu/intel-svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c
index 8ebb353..cfa75c2 100644
--- a/drivers/iommu/intel-svm.c
+++ b/drivers/iommu/intel-svm.c
@@ -39,7 +39,7 @@ int intel_svm_alloc_pasid_tables(struct intel_iommu *iommu)
 	struct page *pages;
 	int order;
 
-	order = ecap_pss(iommu->ecap) + 7 - PAGE_SHIFT;
+	order = ecap_pss(iommu->ecap) + 4 - PAGE_SHIFT;
 	if (order < 0)
 		order = 0;
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-11-10 11:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-12  2:49 [PATCH] iommu/vt-d: Fix the size calculation of pasid table Xunlei Pang
2016-09-19 12:18 ` Joerg Roedel
2016-10-10 13:00   ` Xunlei Pang
2016-10-12 12:17   ` David Woodhouse
2016-10-30 12:18     ` David Woodhouse
2016-10-31 11:30       ` Xunlei Pang
2016-11-10 10:45       ` Joerg Roedel
2016-11-10 11:02         ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).