aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dma_remapping.h10
-rw-r--r--include/linux/dmar.h43
-rw-r--r--include/linux/intel-iommu.h6
3 files changed, 45 insertions, 14 deletions
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h
index bbd8661b3473..ef90cbd8e173 100644
--- a/include/linux/dma_remapping.h
+++ b/include/linux/dma_remapping.h
@@ -25,11 +25,12 @@ struct intel_iommu;
25struct dmar_domain; 25struct dmar_domain;
26struct root_entry; 26struct root_entry;
27 27
28extern void free_dmar_iommu(struct intel_iommu *iommu);
29 28
30#ifdef CONFIG_DMAR 29#ifdef CONFIG_INTEL_IOMMU
30extern void free_dmar_iommu(struct intel_iommu *iommu);
31extern int iommu_calculate_agaw(struct intel_iommu *iommu); 31extern int iommu_calculate_agaw(struct intel_iommu *iommu);
32extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu); 32extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
33extern int dmar_disabled;
33#else 34#else
34static inline int iommu_calculate_agaw(struct intel_iommu *iommu) 35static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
35{ 36{
@@ -39,8 +40,11 @@ static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu)
39{ 40{
40 return 0; 41 return 0;
41} 42}
43static inline void free_dmar_iommu(struct intel_iommu *iommu)
44{
45}
46#define dmar_disabled (1)
42#endif 47#endif
43 48
44extern int dmar_disabled;
45 49
46#endif 50#endif
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 7b776d71d36d..a8b1a847c103 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -26,8 +26,13 @@
26#include <linux/msi.h> 26#include <linux/msi.h>
27#include <linux/irqreturn.h> 27#include <linux/irqreturn.h>
28 28
29/* DMAR Flags */
30#define DMAR_INTR_REMAP 0x1
31#define DMAR_X2APIC_OPT_OUT 0x2
32
29struct intel_iommu; 33struct intel_iommu;
30#if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) 34#ifdef CONFIG_DMAR_TABLE
35extern struct acpi_table_header *dmar_tbl;
31struct dmar_drhd_unit { 36struct dmar_drhd_unit {
32 struct list_head list; /* list of drhd units */ 37 struct list_head list; /* list of drhd units */
33 struct acpi_dmar_header *hdr; /* ACPI header */ 38 struct acpi_dmar_header *hdr; /* ACPI header */
@@ -76,7 +81,7 @@ static inline int enable_drhd_fault_handling(void)
76{ 81{
77 return -1; 82 return -1;
78} 83}
79#endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */ 84#endif /* !CONFIG_DMAR_TABLE */
80 85
81struct irte { 86struct irte {
82 union { 87 union {
@@ -107,10 +112,10 @@ struct irte {
107 }; 112 };
108}; 113};
109 114
110#ifdef CONFIG_INTR_REMAP 115#ifdef CONFIG_IRQ_REMAP
111extern int intr_remapping_enabled; 116extern int intr_remapping_enabled;
112extern int intr_remapping_supported(void); 117extern int intr_remapping_supported(void);
113extern int enable_intr_remapping(int); 118extern int enable_intr_remapping(void);
114extern void disable_intr_remapping(void); 119extern void disable_intr_remapping(void);
115extern int reenable_intr_remapping(int); 120extern int reenable_intr_remapping(int);
116 121
@@ -177,7 +182,7 @@ static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev)
177 182
178#define intr_remapping_enabled (0) 183#define intr_remapping_enabled (0)
179 184
180static inline int enable_intr_remapping(int eim) 185static inline int enable_intr_remapping(void)
181{ 186{
182 return -1; 187 return -1;
183} 188}
@@ -192,6 +197,11 @@ static inline int reenable_intr_remapping(int eim)
192} 197}
193#endif 198#endif
194 199
200enum {
201 IRQ_REMAP_XAPIC_MODE,
202 IRQ_REMAP_X2APIC_MODE,
203};
204
195/* Can't use the common MSI interrupt functions 205/* Can't use the common MSI interrupt functions
196 * since DMAR is not a pci device 206 * since DMAR is not a pci device
197 */ 207 */
@@ -204,7 +214,7 @@ extern int dmar_set_interrupt(struct intel_iommu *iommu);
204extern irqreturn_t dmar_fault(int irq, void *dev_id); 214extern irqreturn_t dmar_fault(int irq, void *dev_id);
205extern int arch_setup_dmar_msi(unsigned int irq); 215extern int arch_setup_dmar_msi(unsigned int irq);
206 216
207#ifdef CONFIG_DMAR 217#ifdef CONFIG_INTEL_IOMMU
208extern int iommu_detected, no_iommu; 218extern int iommu_detected, no_iommu;
209extern struct list_head dmar_rmrr_units; 219extern struct list_head dmar_rmrr_units;
210struct dmar_rmrr_unit { 220struct dmar_rmrr_unit {
@@ -227,9 +237,26 @@ struct dmar_atsr_unit {
227 u8 include_all:1; /* include all ports */ 237 u8 include_all:1; /* include all ports */
228}; 238};
229 239
240int dmar_parse_rmrr_atsr_dev(void);
241extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header);
242extern int dmar_parse_one_atsr(struct acpi_dmar_header *header);
243extern int dmar_parse_dev_scope(void *start, void *end, int *cnt,
244 struct pci_dev ***devices, u16 segment);
230extern int intel_iommu_init(void); 245extern int intel_iommu_init(void);
231#else /* !CONFIG_DMAR: */ 246#else /* !CONFIG_INTEL_IOMMU: */
232static inline int intel_iommu_init(void) { return -ENODEV; } 247static inline int intel_iommu_init(void) { return -ENODEV; }
233#endif /* CONFIG_DMAR */ 248static inline int dmar_parse_one_rmrr(struct acpi_dmar_header *header)
249{
250 return 0;
251}
252static inline int dmar_parse_one_atsr(struct acpi_dmar_header *header)
253{
254 return 0;
255}
256static inline int dmar_parse_rmrr_atsr_dev(void)
257{
258 return 0;
259}
260#endif /* CONFIG_INTEL_IOMMU */
234 261
235#endif /* __DMAR_H__ */ 262#endif /* __DMAR_H__ */
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index 9310c699a37d..235b8879af45 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -279,7 +279,7 @@ struct q_inval {
279 int free_cnt; 279 int free_cnt;
280}; 280};
281 281
282#ifdef CONFIG_INTR_REMAP 282#ifdef CONFIG_IRQ_REMAP
283/* 1MB - maximum possible interrupt remapping table size */ 283/* 1MB - maximum possible interrupt remapping table size */
284#define INTR_REMAP_PAGE_ORDER 8 284#define INTR_REMAP_PAGE_ORDER 8
285#define INTR_REMAP_TABLE_REG_SIZE 0xf 285#define INTR_REMAP_TABLE_REG_SIZE 0xf
@@ -318,7 +318,7 @@ struct intel_iommu {
318 unsigned int irq; 318 unsigned int irq;
319 unsigned char name[13]; /* Device Name */ 319 unsigned char name[13]; /* Device Name */
320 320
321#ifdef CONFIG_DMAR 321#ifdef CONFIG_INTEL_IOMMU
322 unsigned long *domain_ids; /* bitmap of domains */ 322 unsigned long *domain_ids; /* bitmap of domains */
323 struct dmar_domain **domains; /* ptr to domains */ 323 struct dmar_domain **domains; /* ptr to domains */
324 spinlock_t lock; /* protect context, domain ids */ 324 spinlock_t lock; /* protect context, domain ids */
@@ -329,7 +329,7 @@ struct intel_iommu {
329 struct q_inval *qi; /* Queued invalidation info */ 329 struct q_inval *qi; /* Queued invalidation info */
330 u32 *iommu_state; /* Store iommu states between suspend and resume.*/ 330 u32 *iommu_state; /* Store iommu states between suspend and resume.*/
331 331
332#ifdef CONFIG_INTR_REMAP 332#ifdef CONFIG_IRQ_REMAP
333 struct ir_table *ir_table; /* Interrupt remapping info */ 333 struct ir_table *ir_table; /* Interrupt remapping info */
334#endif 334#endif
335 int node; 335 int node;