aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel-pasid.h
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2018-12-10 09:58:56 +0800
committerJoerg Roedel <jroedel@suse.de>2018-12-11 10:45:57 +0100
commit0bbeb01a4fafbf8422e5c8882d461d6ac4f71e15 (patch)
tree13fb70fbca6f9377d23584c0a943172a97646e93 /drivers/iommu/intel-pasid.h
parentiommu/vt-d: Enumerate the scalable mode capability (diff)
downloadlinux-dev-0bbeb01a4fafbf8422e5c8882d461d6ac4f71e15.tar.xz
linux-dev-0bbeb01a4fafbf8422e5c8882d461d6ac4f71e15.zip
iommu/vt-d: Manage scalalble mode PASID tables
In scalable mode, pasid structure is a two level table with a pasid directory table and a pasid table. Any pasid entry can be identified by a pasid value in below way. 1 9 6 5 0 .-----------------------.-------. | PASID | | '-----------------------'-------' .-------------. | | | | | | | | | | | | | .-----------. | .-------------. | | | |----->| PASID Entry | | | | | '-------------' | | | |Plus | | | .-----------. | | | |---->| DIR Entry |-------->| | | '-----------' '-------------' .---------. |Plus | | | Context | | | | | Entry |------->| | '---------' '-----------' This changes the pasid table APIs to support scalable mode PASID directory and PASID table. It also adds a helper to get the PASID table entry according to the pasid value. Cc: Ashok Raj <ashok.raj@intel.com> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> Cc: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Sanjay Kumar <sanjay.k.kumar@intel.com> Signed-off-by: Liu Yi L <yi.l.liu@intel.com> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Ashok Raj <ashok.raj@intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel-pasid.h')
-rw-r--r--drivers/iommu/intel-pasid.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/iommu/intel-pasid.h b/drivers/iommu/intel-pasid.h
index 1fb5e12b029a..12f480c2bb8b 100644
--- a/drivers/iommu/intel-pasid.h
+++ b/drivers/iommu/intel-pasid.h
@@ -11,12 +11,20 @@
#define __INTEL_PASID_H
#define PASID_MIN 0x1
-#define PASID_MAX 0x20000
+#define PASID_MAX 0x100000
+#define PASID_PTE_MASK 0x3F
+#define PASID_PTE_PRESENT 1
+#define PDE_PFN_MASK PAGE_MASK
+#define PASID_PDE_SHIFT 6
-struct pasid_entry {
+struct pasid_dir_entry {
u64 val;
};
+struct pasid_entry {
+ u64 val[8];
+};
+
/* The representative of a PASID table */
struct pasid_table {
void *table; /* pasid table pointer */