summaryrefslogtreecommitdiff
path: root/drivers/iommu/intel/cap_audit.h
diff options
context:
space:
mode:
authorKyung Min Park <kyung.min.park@intel.com>2021-02-04 04:43:57 +0300
committerJoerg Roedel <jroedel@suse.de>2021-02-04 16:42:00 +0300
commit010bf5659e01b0a169e8e6b9e6a8b7e62209470d (patch)
tree57dff80e711070e1fd8cfdddefec9b57f6b31dfa /drivers/iommu/intel/cap_audit.h
parentad3d19029979b19378ece2011fc8ce07be98c905 (diff)
downloadlinux-010bf5659e01b0a169e8e6b9e6a8b7e62209470d.tar.xz
iommu/vt-d: Move capability check code to cap_audit files
Move IOMMU capability check and sanity check code to cap_audit files. Also implement some helper functions for sanity checks. Signed-off-by: Kyung Min Park <kyung.min.park@intel.com> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Link: https://lore.kernel.org/r/20210130184452.31711-1-kyung.min.park@intel.com Link: https://lore.kernel.org/r/20210204014401.2846425-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel/cap_audit.h')
-rw-r--r--drivers/iommu/intel/cap_audit.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/iommu/intel/cap_audit.h b/drivers/iommu/intel/cap_audit.h
index a6a1530441b7..74cfccae0e81 100644
--- a/drivers/iommu/intel/cap_audit.h
+++ b/drivers/iommu/intel/cap_audit.h
@@ -107,4 +107,24 @@ enum cap_audit_type {
CAP_AUDIT_HOTPLUG_IRQR,
};
+bool intel_cap_smts_sanity(void);
+bool intel_cap_pasid_sanity(void);
+bool intel_cap_nest_sanity(void);
+bool intel_cap_flts_sanity(void);
+
+static inline bool scalable_mode_support(void)
+{
+ return (intel_iommu_sm && intel_cap_smts_sanity());
+}
+
+static inline bool pasid_mode_support(void)
+{
+ return scalable_mode_support() && intel_cap_pasid_sanity();
+}
+
+static inline bool nested_mode_support(void)
+{
+ return scalable_mode_support() && intel_cap_nest_sanity();
+}
+
int intel_cap_audit(enum cap_audit_type type, struct intel_iommu *iommu);