aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-29 23:00:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-29 23:00:13 -0500
commitb3a4bcaa5a56860610bd096829702f80273b5a67 (patch)
tree57a37e12d5fc8be6540e9f98cd381f6fb5e06654 /include/linux
parent17c7f85460d6b0e2bd11a736683bd81c4388474f (diff)
parentdd1a175695edf662615e422d1c85eae875a411b2 (diff)
Merge tag 'iommu-updates-v3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull IOMMU Updates from Joerg Roedel: "A few patches have been queued up for this merge window: - improvements for the ARM-SMMU driver (IOMMU_EXEC support, IOMMU group support) - updates and fixes for the shmobile IOMMU driver - various fixes to generic IOMMU code and the Intel IOMMU driver - some cleanups in IOMMU drivers (dev_is_pci() usage)" * tag 'iommu-updates-v3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (36 commits) iommu/vt-d: Fix signedness bug in alloc_irte() iommu/vt-d: free all resources if failed to initialize DMARs iommu/vt-d, trivial: clean sparse warnings iommu/vt-d: fix wrong return value of dmar_table_init() iommu/vt-d: release invalidation queue when destroying IOMMU unit iommu/vt-d: fix access after free issue in function free_dmar_iommu() iommu/vt-d: keep shared resources when failed to initialize iommu devices iommu/vt-d: fix invalid memory access when freeing DMAR irq iommu/vt-d, trivial: simplify code with existing macros iommu/vt-d, trivial: use defined macro instead of hardcoding iommu/vt-d: mark internal functions as static iommu/vt-d, trivial: clean up unused code iommu/vt-d, trivial: check suitable flag in function detect_intel_iommu() iommu/vt-d, trivial: print correct domain id of static identity domain iommu/vt-d, trivial: refine support of 64bit guest address iommu/vt-d: fix resource leakage on error recovery path in iommu_init_domains() iommu/vt-d: fix a race window in allocating domain ID for virtual machines iommu/vt-d: fix PCI device reference leakage on error recovery path drm/msm: Fix link error with !MSM_IOMMU iommu/vt-d: use dedicated bitmap to track remapping entry allocation status ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dma_remapping.h4
-rw-r--r--include/linux/dmar.h13
-rw-r--r--include/linux/intel-iommu.h3
-rw-r--r--include/linux/iommu.h16
4 files changed, 20 insertions, 16 deletions
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h
index 57c9a8ae4f2d..7ac17f57250e 100644
--- a/include/linux/dma_remapping.h
+++ b/include/linux/dma_remapping.h
@@ -27,7 +27,6 @@ struct root_entry;
27 27
28 28
29#ifdef CONFIG_INTEL_IOMMU 29#ifdef CONFIG_INTEL_IOMMU
30extern void free_dmar_iommu(struct intel_iommu *iommu);
31extern int iommu_calculate_agaw(struct intel_iommu *iommu); 30extern int iommu_calculate_agaw(struct intel_iommu *iommu);
32extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu); 31extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
33extern int dmar_disabled; 32extern int dmar_disabled;
@@ -41,9 +40,6 @@ static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu)
41{ 40{
42 return 0; 41 return 0;
43} 42}
44static inline void free_dmar_iommu(struct intel_iommu *iommu)
45{
46}
47#define dmar_disabled (1) 43#define dmar_disabled (1)
48#define intel_iommu_enabled (0) 44#define intel_iommu_enabled (0)
49#endif 45#endif
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index b029d1aa2d12..eccb0c0c6cf6 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -33,6 +33,7 @@ struct acpi_dmar_header;
33#define DMAR_X2APIC_OPT_OUT 0x2 33#define DMAR_X2APIC_OPT_OUT 0x2
34 34
35struct intel_iommu; 35struct intel_iommu;
36
36#ifdef CONFIG_DMAR_TABLE 37#ifdef CONFIG_DMAR_TABLE
37extern struct acpi_table_header *dmar_tbl; 38extern struct acpi_table_header *dmar_tbl;
38struct dmar_drhd_unit { 39struct dmar_drhd_unit {
@@ -52,6 +53,10 @@ extern struct list_head dmar_drhd_units;
52#define for_each_drhd_unit(drhd) \ 53#define for_each_drhd_unit(drhd) \
53 list_for_each_entry(drhd, &dmar_drhd_units, list) 54 list_for_each_entry(drhd, &dmar_drhd_units, list)
54 55
56#define for_each_active_drhd_unit(drhd) \
57 list_for_each_entry(drhd, &dmar_drhd_units, list) \
58 if (drhd->ignored) {} else
59
55#define for_each_active_iommu(i, drhd) \ 60#define for_each_active_iommu(i, drhd) \
56 list_for_each_entry(drhd, &dmar_drhd_units, list) \ 61 list_for_each_entry(drhd, &dmar_drhd_units, list) \
57 if (i=drhd->iommu, drhd->ignored) {} else 62 if (i=drhd->iommu, drhd->ignored) {} else
@@ -62,13 +67,13 @@ extern struct list_head dmar_drhd_units;
62 67
63extern int dmar_table_init(void); 68extern int dmar_table_init(void);
64extern int dmar_dev_scope_init(void); 69extern int dmar_dev_scope_init(void);
70extern int dmar_parse_dev_scope(void *start, void *end, int *cnt,
71 struct pci_dev ***devices, u16 segment);
72extern void dmar_free_dev_scope(struct pci_dev ***devices, int *cnt);
65 73
66/* Intel IOMMU detection */ 74/* Intel IOMMU detection */
67extern int detect_intel_iommu(void); 75extern int detect_intel_iommu(void);
68extern int enable_drhd_fault_handling(void); 76extern int enable_drhd_fault_handling(void);
69
70extern int parse_ioapics_under_ir(void);
71extern int alloc_iommu(struct dmar_drhd_unit *);
72#else 77#else
73static inline int detect_intel_iommu(void) 78static inline int detect_intel_iommu(void)
74{ 79{
@@ -157,8 +162,6 @@ struct dmar_atsr_unit {
157int dmar_parse_rmrr_atsr_dev(void); 162int dmar_parse_rmrr_atsr_dev(void);
158extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header); 163extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header);
159extern int dmar_parse_one_atsr(struct acpi_dmar_header *header); 164extern int dmar_parse_one_atsr(struct acpi_dmar_header *header);
160extern int dmar_parse_dev_scope(void *start, void *end, int *cnt,
161 struct pci_dev ***devices, u16 segment);
162extern int intel_iommu_init(void); 165extern int intel_iommu_init(void);
163#else /* !CONFIG_INTEL_IOMMU: */ 166#else /* !CONFIG_INTEL_IOMMU: */
164static inline int intel_iommu_init(void) { return -ENODEV; } 167static inline int intel_iommu_init(void) { return -ENODEV; }
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index d380c5e68008..2c4bed593b32 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -288,6 +288,7 @@ struct q_inval {
288 288
289struct ir_table { 289struct ir_table {
290 struct irte *base; 290 struct irte *base;
291 unsigned long *bitmap;
291}; 292};
292#endif 293#endif
293 294
@@ -347,8 +348,6 @@ static inline void __iommu_flush_cache(
347extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev); 348extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev);
348extern int dmar_find_matched_atsr_unit(struct pci_dev *dev); 349extern int dmar_find_matched_atsr_unit(struct pci_dev *dev);
349 350
350extern int alloc_iommu(struct dmar_drhd_unit *drhd);
351extern void free_iommu(struct intel_iommu *iommu);
352extern int dmar_enable_qi(struct intel_iommu *iommu); 351extern int dmar_enable_qi(struct intel_iommu *iommu);
353extern void dmar_disable_qi(struct intel_iommu *iommu); 352extern void dmar_disable_qi(struct intel_iommu *iommu);
354extern int dmar_reenable_qi(struct intel_iommu *iommu); 353extern int dmar_reenable_qi(struct intel_iommu *iommu);
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index a444c790fa72..b96a5b2136e4 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -24,9 +24,10 @@
24#include <linux/types.h> 24#include <linux/types.h>
25#include <trace/events/iommu.h> 25#include <trace/events/iommu.h>
26 26
27#define IOMMU_READ (1) 27#define IOMMU_READ (1 << 0)
28#define IOMMU_WRITE (2) 28#define IOMMU_WRITE (1 << 1)
29#define IOMMU_CACHE (4) /* DMA cache coherency */ 29#define IOMMU_CACHE (1 << 2) /* DMA cache coherency */
30#define IOMMU_EXEC (1 << 3)
30 31
31struct iommu_ops; 32struct iommu_ops;
32struct iommu_group; 33struct iommu_group;
@@ -247,6 +248,11 @@ static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
247 return NULL; 248 return NULL;
248} 249}
249 250
251static inline struct iommu_group *iommu_group_get_by_id(int id)
252{
253 return NULL;
254}
255
250static inline void iommu_domain_free(struct iommu_domain *domain) 256static inline void iommu_domain_free(struct iommu_domain *domain)
251{ 257{
252} 258}
@@ -291,8 +297,8 @@ static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_ad
291 return 0; 297 return 0;
292} 298}
293 299
294static inline int domain_has_cap(struct iommu_domain *domain, 300static inline int iommu_domain_has_cap(struct iommu_domain *domain,
295 unsigned long cap) 301 unsigned long cap)
296{ 302{
297 return 0; 303 return 0;
298} 304}