diff options
-rw-r--r-- | arch/x86/include/asm/io_apic.h | 5 | ||||
-rw-r--r-- | arch/x86/include/asm/x86_init.h | 5 | ||||
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 14 | ||||
-rw-r--r-- | arch/x86/kernel/x86_init.c | 1 | ||||
-rw-r--r-- | drivers/iommu/irq_remapping.c | 1 |
5 files changed, 17 insertions, 9 deletions
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index a744cbbe02de..71f5f0865e7c 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h | |||
@@ -149,6 +149,10 @@ extern int io_apic_set_pci_routing(struct device *dev, int irq, | |||
149 | void setup_IO_APIC_irq_extra(u32 gsi); | 149 | void setup_IO_APIC_irq_extra(u32 gsi); |
150 | extern void ioapic_insert_resources(void); | 150 | extern void ioapic_insert_resources(void); |
151 | 151 | ||
152 | extern int native_setup_ioapic_entry(int, struct IO_APIC_route_entry *, | ||
153 | unsigned int, int, | ||
154 | struct io_apic_irq_attr *); | ||
155 | |||
152 | int io_apic_setup_irq_pin_once(unsigned int irq, int node, struct io_apic_irq_attr *attr); | 156 | int io_apic_setup_irq_pin_once(unsigned int irq, int node, struct io_apic_irq_attr *attr); |
153 | 157 | ||
154 | extern int save_ioapic_entries(void); | 158 | extern int save_ioapic_entries(void); |
@@ -232,6 +236,7 @@ static inline void disable_ioapic_support(void) { } | |||
232 | #define native_disable_io_apic NULL | 236 | #define native_disable_io_apic NULL |
233 | #define native_io_apic_print_entries NULL | 237 | #define native_io_apic_print_entries NULL |
234 | #define native_ioapic_set_affinity NULL | 238 | #define native_ioapic_set_affinity NULL |
239 | #define native_setup_ioapic_entry NULL | ||
235 | #endif | 240 | #endif |
236 | 241 | ||
237 | #endif /* _ASM_X86_IO_APIC_H */ | 242 | #endif /* _ASM_X86_IO_APIC_H */ |
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 20d9f97c14a2..17da29cf1a47 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h | |||
@@ -190,6 +190,8 @@ struct x86_msi_ops { | |||
190 | int (*setup_hpet_msi)(unsigned int irq, unsigned int id); | 190 | int (*setup_hpet_msi)(unsigned int irq, unsigned int id); |
191 | }; | 191 | }; |
192 | 192 | ||
193 | struct IO_APIC_route_entry; | ||
194 | struct io_apic_irq_attr; | ||
193 | struct irq_data; | 195 | struct irq_data; |
194 | struct cpumask; | 196 | struct cpumask; |
195 | 197 | ||
@@ -203,6 +205,9 @@ struct x86_io_apic_ops { | |||
203 | int (*set_affinity)(struct irq_data *data, | 205 | int (*set_affinity)(struct irq_data *data, |
204 | const struct cpumask *mask, | 206 | const struct cpumask *mask, |
205 | bool force); | 207 | bool force); |
208 | int (*setup_entry)(int irq, struct IO_APIC_route_entry *entry, | ||
209 | unsigned int destination, int vector, | ||
210 | struct io_apic_irq_attr *attr); | ||
206 | }; | 211 | }; |
207 | 212 | ||
208 | extern struct x86_init_ops x86_init; | 213 | extern struct x86_init_ops x86_init; |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index d9ca3be9636c..9a7131f29c83 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -1315,14 +1315,10 @@ static void ioapic_register_intr(unsigned int irq, struct irq_cfg *cfg, | |||
1315 | fasteoi ? "fasteoi" : "edge"); | 1315 | fasteoi ? "fasteoi" : "edge"); |
1316 | } | 1316 | } |
1317 | 1317 | ||
1318 | static int setup_ioapic_entry(int irq, struct IO_APIC_route_entry *entry, | 1318 | int native_setup_ioapic_entry(int irq, struct IO_APIC_route_entry *entry, |
1319 | unsigned int destination, int vector, | 1319 | unsigned int destination, int vector, |
1320 | struct io_apic_irq_attr *attr) | 1320 | struct io_apic_irq_attr *attr) |
1321 | { | 1321 | { |
1322 | if (irq_remapping_enabled) | ||
1323 | return setup_ioapic_remapped_entry(irq, entry, destination, | ||
1324 | vector, attr); | ||
1325 | |||
1326 | memset(entry, 0, sizeof(*entry)); | 1322 | memset(entry, 0, sizeof(*entry)); |
1327 | 1323 | ||
1328 | entry->delivery_mode = apic->irq_delivery_mode; | 1324 | entry->delivery_mode = apic->irq_delivery_mode; |
@@ -1370,8 +1366,8 @@ static void setup_ioapic_irq(unsigned int irq, struct irq_cfg *cfg, | |||
1370 | attr->ioapic, mpc_ioapic_id(attr->ioapic), attr->ioapic_pin, | 1366 | attr->ioapic, mpc_ioapic_id(attr->ioapic), attr->ioapic_pin, |
1371 | cfg->vector, irq, attr->trigger, attr->polarity, dest); | 1367 | cfg->vector, irq, attr->trigger, attr->polarity, dest); |
1372 | 1368 | ||
1373 | if (setup_ioapic_entry(irq, &entry, dest, cfg->vector, attr)) { | 1369 | if (x86_io_apic_ops.setup_entry(irq, &entry, dest, cfg->vector, attr)) { |
1374 | pr_warn("Failed to setup ioapic entry for ioapic %d, pin %d\n", | 1370 | pr_warn("Failed to setup ioapic entry for ioapic %d, pin %d\n", |
1375 | mpc_ioapic_id(attr->ioapic), attr->ioapic_pin); | 1371 | mpc_ioapic_id(attr->ioapic), attr->ioapic_pin); |
1376 | __clear_irq_vector(irq, cfg); | 1372 | __clear_irq_vector(irq, cfg); |
1377 | 1373 | ||
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 2ca3475e90a8..06db44f4fbf5 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c | |||
@@ -127,4 +127,5 @@ struct x86_io_apic_ops x86_io_apic_ops = { | |||
127 | .disable = native_disable_io_apic, | 127 | .disable = native_disable_io_apic, |
128 | .print_entries = native_io_apic_print_entries, | 128 | .print_entries = native_io_apic_print_entries, |
129 | .set_affinity = native_ioapic_set_affinity, | 129 | .set_affinity = native_ioapic_set_affinity, |
130 | .setup_entry = native_setup_ioapic_entry, | ||
130 | }; | 131 | }; |
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index 67b243c6c4e9..886ad67987fd 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c | |||
@@ -146,6 +146,7 @@ static void __init irq_remapping_modify_x86_ops(void) | |||
146 | { | 146 | { |
147 | x86_io_apic_ops.disable = irq_remapping_disable_io_apic; | 147 | x86_io_apic_ops.disable = irq_remapping_disable_io_apic; |
148 | x86_io_apic_ops.set_affinity = set_remapped_irq_affinity; | 148 | x86_io_apic_ops.set_affinity = set_remapped_irq_affinity; |
149 | x86_io_apic_ops.setup_entry = setup_ioapic_remapped_entry; | ||
149 | x86_msi.setup_msi_irqs = irq_remapping_setup_msi_irqs; | 150 | x86_msi.setup_msi_irqs = irq_remapping_setup_msi_irqs; |
150 | x86_msi.setup_hpet_msi = setup_hpet_msi_remapped; | 151 | x86_msi.setup_hpet_msi = setup_hpet_msi_remapped; |
151 | } | 152 | } |