diff options
-rw-r--r-- | arch/x86/include/asm/irq_remapping.h | 22 | ||||
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 17 | ||||
-rw-r--r-- | drivers/iommu/intel_intr_remapping.c | 20 | ||||
-rw-r--r-- | include/linux/dmar.h | 59 |
4 files changed, 26 insertions, 92 deletions
diff --git a/arch/x86/include/asm/irq_remapping.h b/arch/x86/include/asm/irq_remapping.h deleted file mode 100644 index 0ddfc0b90adb..000000000000 --- a/arch/x86/include/asm/irq_remapping.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | #ifndef _ASM_X86_IRQ_REMAPPING_H | ||
2 | #define _ASM_X86_IRQ_REMAPPING_H | ||
3 | |||
4 | #define IRTE_DEST(dest) ((x2apic_mode) ? dest : dest << 8) | ||
5 | |||
6 | #ifdef CONFIG_IRQ_REMAP | ||
7 | static void irq_remap_modify_chip_defaults(struct irq_chip *chip); | ||
8 | static inline bool irq_remapped(struct irq_cfg *cfg) | ||
9 | { | ||
10 | return cfg->irq_2_iommu.iommu != NULL; | ||
11 | } | ||
12 | #else | ||
13 | static inline bool irq_remapped(struct irq_cfg *cfg) | ||
14 | { | ||
15 | return false; | ||
16 | } | ||
17 | static inline void irq_remap_modify_chip_defaults(struct irq_chip *chip) | ||
18 | { | ||
19 | } | ||
20 | #endif | ||
21 | |||
22 | #endif /* _ASM_X86_IRQ_REMAPPING_H */ | ||
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 3db693bda91d..073edd1d3c66 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -58,7 +58,6 @@ | |||
58 | #include <asm/hypertransport.h> | 58 | #include <asm/hypertransport.h> |
59 | #include <asm/setup.h> | 59 | #include <asm/setup.h> |
60 | #include <asm/intr_remapping.h> | 60 | #include <asm/intr_remapping.h> |
61 | #include <asm/irq_remapping.h> | ||
62 | #include <asm/hpet.h> | 61 | #include <asm/hpet.h> |
63 | #include <asm/hw_irq.h> | 62 | #include <asm/hw_irq.h> |
64 | 63 | ||
@@ -87,6 +86,22 @@ void __init set_io_apic_ops(const struct io_apic_ops *ops) | |||
87 | io_apic_ops = *ops; | 86 | io_apic_ops = *ops; |
88 | } | 87 | } |
89 | 88 | ||
89 | #ifdef CONFIG_IRQ_REMAP | ||
90 | static void irq_remap_modify_chip_defaults(struct irq_chip *chip); | ||
91 | static inline bool irq_remapped(struct irq_cfg *cfg) | ||
92 | { | ||
93 | return cfg->irq_2_iommu.iommu != NULL; | ||
94 | } | ||
95 | #else | ||
96 | static inline bool irq_remapped(struct irq_cfg *cfg) | ||
97 | { | ||
98 | return false; | ||
99 | } | ||
100 | static inline void irq_remap_modify_chip_defaults(struct irq_chip *chip) | ||
101 | { | ||
102 | } | ||
103 | #endif | ||
104 | |||
90 | /* | 105 | /* |
91 | * Is the SiS APIC rmw bug present ? | 106 | * Is the SiS APIC rmw bug present ? |
92 | * -1 = don't know, 0 = no, 1 = yes | 107 | * -1 = don't know, 0 = no, 1 = yes |
diff --git a/drivers/iommu/intel_intr_remapping.c b/drivers/iommu/intel_intr_remapping.c index a3bae67ec43c..7472634df350 100644 --- a/drivers/iommu/intel_intr_remapping.c +++ b/drivers/iommu/intel_intr_remapping.c | |||
@@ -64,7 +64,7 @@ int get_irte(int irq, struct irte *entry) | |||
64 | return 0; | 64 | return 0; |
65 | } | 65 | } |
66 | 66 | ||
67 | int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) | 67 | static int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) |
68 | { | 68 | { |
69 | struct ir_table *table = iommu->ir_table; | 69 | struct ir_table *table = iommu->ir_table; |
70 | struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); | 70 | struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); |
@@ -136,7 +136,7 @@ static int qi_flush_iec(struct intel_iommu *iommu, int index, int mask) | |||
136 | return qi_submit_sync(&desc, iommu); | 136 | return qi_submit_sync(&desc, iommu); |
137 | } | 137 | } |
138 | 138 | ||
139 | int map_irq_to_irte_handle(int irq, u16 *sub_handle) | 139 | static int map_irq_to_irte_handle(int irq, u16 *sub_handle) |
140 | { | 140 | { |
141 | struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); | 141 | struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); |
142 | unsigned long flags; | 142 | unsigned long flags; |
@@ -152,7 +152,7 @@ int map_irq_to_irte_handle(int irq, u16 *sub_handle) | |||
152 | return index; | 152 | return index; |
153 | } | 153 | } |
154 | 154 | ||
155 | int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle) | 155 | static int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle) |
156 | { | 156 | { |
157 | struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); | 157 | struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); |
158 | unsigned long flags; | 158 | unsigned long flags; |
@@ -172,7 +172,7 @@ int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle) | |||
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | int modify_irte(int irq, struct irte *irte_modified) | 175 | static int modify_irte(int irq, struct irte *irte_modified) |
176 | { | 176 | { |
177 | struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); | 177 | struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); |
178 | struct intel_iommu *iommu; | 178 | struct intel_iommu *iommu; |
@@ -200,7 +200,7 @@ int modify_irte(int irq, struct irte *irte_modified) | |||
200 | return rc; | 200 | return rc; |
201 | } | 201 | } |
202 | 202 | ||
203 | struct intel_iommu *map_hpet_to_ir(u8 hpet_id) | 203 | static struct intel_iommu *map_hpet_to_ir(u8 hpet_id) |
204 | { | 204 | { |
205 | int i; | 205 | int i; |
206 | 206 | ||
@@ -210,7 +210,7 @@ struct intel_iommu *map_hpet_to_ir(u8 hpet_id) | |||
210 | return NULL; | 210 | return NULL; |
211 | } | 211 | } |
212 | 212 | ||
213 | struct intel_iommu *map_ioapic_to_ir(int apic) | 213 | static struct intel_iommu *map_ioapic_to_ir(int apic) |
214 | { | 214 | { |
215 | int i; | 215 | int i; |
216 | 216 | ||
@@ -220,7 +220,7 @@ struct intel_iommu *map_ioapic_to_ir(int apic) | |||
220 | return NULL; | 220 | return NULL; |
221 | } | 221 | } |
222 | 222 | ||
223 | struct intel_iommu *map_dev_to_ir(struct pci_dev *dev) | 223 | static struct intel_iommu *map_dev_to_ir(struct pci_dev *dev) |
224 | { | 224 | { |
225 | struct dmar_drhd_unit *drhd; | 225 | struct dmar_drhd_unit *drhd; |
226 | 226 | ||
@@ -312,7 +312,7 @@ static void set_irte_sid(struct irte *irte, unsigned int svt, | |||
312 | irte->sid = sid; | 312 | irte->sid = sid; |
313 | } | 313 | } |
314 | 314 | ||
315 | int set_ioapic_sid(struct irte *irte, int apic) | 315 | static int set_ioapic_sid(struct irte *irte, int apic) |
316 | { | 316 | { |
317 | int i; | 317 | int i; |
318 | u16 sid = 0; | 318 | u16 sid = 0; |
@@ -337,7 +337,7 @@ int set_ioapic_sid(struct irte *irte, int apic) | |||
337 | return 0; | 337 | return 0; |
338 | } | 338 | } |
339 | 339 | ||
340 | int set_hpet_sid(struct irte *irte, u8 id) | 340 | static int set_hpet_sid(struct irte *irte, u8 id) |
341 | { | 341 | { |
342 | int i; | 342 | int i; |
343 | u16 sid = 0; | 343 | u16 sid = 0; |
@@ -367,7 +367,7 @@ int set_hpet_sid(struct irte *irte, u8 id) | |||
367 | return 0; | 367 | return 0; |
368 | } | 368 | } |
369 | 369 | ||
370 | int set_msi_sid(struct irte *irte, struct pci_dev *dev) | 370 | static int set_msi_sid(struct irte *irte, struct pci_dev *dev) |
371 | { | 371 | { |
372 | struct pci_dev *bridge; | 372 | struct pci_dev *bridge; |
373 | 373 | ||
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 7a207a39f879..b029d1aa2d12 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -114,65 +114,6 @@ struct irte { | |||
114 | }; | 114 | }; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | #ifdef CONFIG_IRQ_REMAP | ||
118 | extern int get_irte(int irq, struct irte *entry); | ||
119 | extern int modify_irte(int irq, struct irte *irte_modified); | ||
120 | extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count); | ||
121 | extern int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, | ||
122 | u16 sub_handle); | ||
123 | extern int map_irq_to_irte_handle(int irq, u16 *sub_handle); | ||
124 | |||
125 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); | ||
126 | extern struct intel_iommu *map_ioapic_to_ir(int apic); | ||
127 | extern struct intel_iommu *map_hpet_to_ir(u8 id); | ||
128 | extern int set_ioapic_sid(struct irte *irte, int apic); | ||
129 | extern int set_hpet_sid(struct irte *irte, u8 id); | ||
130 | extern int set_msi_sid(struct irte *irte, struct pci_dev *dev); | ||
131 | #else | ||
132 | static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) | ||
133 | { | ||
134 | return -1; | ||
135 | } | ||
136 | static inline int modify_irte(int irq, struct irte *irte_modified) | ||
137 | { | ||
138 | return -1; | ||
139 | } | ||
140 | static inline int map_irq_to_irte_handle(int irq, u16 *sub_handle) | ||
141 | { | ||
142 | return -1; | ||
143 | } | ||
144 | static inline int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, | ||
145 | u16 sub_handle) | ||
146 | { | ||
147 | return -1; | ||
148 | } | ||
149 | static inline struct intel_iommu *map_dev_to_ir(struct pci_dev *dev) | ||
150 | { | ||
151 | return NULL; | ||
152 | } | ||
153 | static inline struct intel_iommu *map_ioapic_to_ir(int apic) | ||
154 | { | ||
155 | return NULL; | ||
156 | } | ||
157 | static inline struct intel_iommu *map_hpet_to_ir(unsigned int hpet_id) | ||
158 | { | ||
159 | return NULL; | ||
160 | } | ||
161 | static inline int set_ioapic_sid(struct irte *irte, int apic) | ||
162 | { | ||
163 | return 0; | ||
164 | } | ||
165 | static inline int set_hpet_sid(struct irte *irte, u8 id) | ||
166 | { | ||
167 | return -1; | ||
168 | } | ||
169 | static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev) | ||
170 | { | ||
171 | return 0; | ||
172 | } | ||
173 | |||
174 | #endif | ||
175 | |||
176 | enum { | 117 | enum { |
177 | IRQ_REMAP_XAPIC_MODE, | 118 | IRQ_REMAP_XAPIC_MODE, |
178 | IRQ_REMAP_X2APIC_MODE, | 119 | IRQ_REMAP_X2APIC_MODE, |