summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2015-05-28 18:41:33 +0200
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:15:09 -0700
commitef3a0f2227741c4bfeb91b03b64349feb5a1bd53 (patch)
treec5efc318ad84b401ad97afd522d59bdebf5c7e44 /include/linux
parent2944c708c952d0a4af0c1173485300ab15500d97 (diff)
iommu: Introduce direct mapped region handling
Add two new functions to the IOMMU-API to allow the IOMMU drivers to export the requirements for direct mapped regions per device. This is useful for exporting the information in Intel VT-d's RMRR entries or AMD-Vi's unity mappings. Change-Id: Iab55341a8526084a5110dc5a2d4448fd46e3296a Signed-off-by: Joerg Roedel <jroedel@suse.de> [pdaly@codeaurora.org Resolve minor conflicts]
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/iommu.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 29dc5c2c9b8e..3ceee4600d52 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -131,6 +131,20 @@ enum iommu_attr {
extern struct dentry *iommu_debugfs_top;
+/**
+ * struct iommu_dm_region - descriptor for a direct mapped memory region
+ * @list: Linked list pointers
+ * @start: System physical start address of the region
+ * @length: Length of the region in bytes
+ * @prot: IOMMU Protection flags (READ/WRITE/...)
+ */
+struct iommu_dm_region {
+ struct list_head list;
+ phys_addr_t start;
+ size_t length;
+ int prot;
+};
+
#ifdef CONFIG_IOMMU_API
/**
@@ -182,6 +196,10 @@ struct iommu_ops {
int (*domain_set_attr)(struct iommu_domain *domain,
enum iommu_attr attr, void *data);
+ /* Request/Free a list of direct mapping requirements for a device */
+ void (*get_dm_regions)(struct device *dev, struct list_head *list);
+ void (*put_dm_regions)(struct device *dev, struct list_head *list);
+
/* Window handling functions */
int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr,
phys_addr_t paddr, u64 size, int prot);
@@ -245,6 +263,9 @@ extern unsigned long iommu_reg_read(struct iommu_domain *domain,
extern void iommu_reg_write(struct iommu_domain *domain, unsigned long offset,
unsigned long val);
+extern void iommu_get_dm_regions(struct device *dev, struct list_head *list);
+extern void iommu_put_dm_regions(struct device *dev, struct list_head *list);
+
extern int iommu_attach_group(struct iommu_domain *domain,
struct iommu_group *group);
extern void iommu_detach_group(struct iommu_domain *domain,
@@ -454,6 +475,16 @@ static inline void iommu_reg_write(struct iommu_domain *domain,
{
}
+static inline void iommu_get_dm_regions(struct device *dev,
+ struct list_head *list)
+{
+}
+
+static inline void iommu_put_dm_regions(struct device *dev,
+ struct list_head *list)
+{
+}
+
static inline int iommu_attach_group(struct iommu_domain *domain,
struct iommu_group *group)
{