diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2012-03-30 14:47:07 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-05-07 08:35:00 -0400 |
commit | 95a02e976c39d63716b8c7c226bc530a2041536f (patch) | |
tree | 8c8992e117ad625491f3233f71674e40825474da /arch/x86 | |
parent | 263b5e8629c9ce21c9cd4c0e29c097afb1c10ef3 (diff) |
iommu: rename intr_remapping references to irq_remapping
Make the code consistent with the naming conventions of irq subsystem.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Joerg Roedel <joerg.roedel@amd.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/intr_remapping.h | 94 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 22 | ||||
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 41 |
3 files changed, 80 insertions, 77 deletions
diff --git a/arch/x86/include/asm/intr_remapping.h b/arch/x86/include/asm/intr_remapping.h index a6afd6efa6c6..f9cbbcb2956e 100644 --- a/arch/x86/include/asm/intr_remapping.h +++ b/arch/x86/include/asm/intr_remapping.h | |||
@@ -28,71 +28,73 @@ struct IO_APIC_route_entry; | |||
28 | struct io_apic_irq_attr; | 28 | struct io_apic_irq_attr; |
29 | struct pci_dev; | 29 | struct pci_dev; |
30 | 30 | ||
31 | extern int intr_remapping_enabled; | 31 | extern int irq_remapping_enabled; |
32 | 32 | ||
33 | extern void setup_intr_remapping(void); | 33 | extern void setup_irq_remapping_ops(void); |
34 | extern int intr_remapping_supported(void); | 34 | extern int irq_remapping_supported(void); |
35 | extern int intr_hardware_init(void); | 35 | extern int irq_remapping_prepare(void); |
36 | extern int intr_hardware_enable(void); | 36 | extern int irq_remapping_enable(void); |
37 | extern void intr_hardware_disable(void); | 37 | extern void irq_remapping_disable(void); |
38 | extern int intr_hardware_reenable(int); | 38 | extern int irq_remapping_reenable(int); |
39 | extern int intr_enable_fault_handling(void); | 39 | extern int irq_remap_enable_fault_handling(void); |
40 | extern int intr_setup_ioapic_entry(int irq, | 40 | extern int setup_ioapic_remapped_entry(int irq, |
41 | struct IO_APIC_route_entry *entry, | 41 | struct IO_APIC_route_entry *entry, |
42 | unsigned int destination, int vector, | 42 | unsigned int destination, |
43 | struct io_apic_irq_attr *attr); | 43 | int vector, |
44 | extern int intr_set_affinity(struct irq_data *data, | 44 | struct io_apic_irq_attr *attr); |
45 | const struct cpumask *mask, | 45 | extern int set_remapped_irq_affinity(struct irq_data *data, |
46 | bool force); | 46 | const struct cpumask *mask, |
47 | extern void intr_free_irq(int irq); | 47 | bool force); |
48 | extern void intr_compose_msi_msg(struct pci_dev *pdev, | 48 | extern void free_remapped_irq(int irq); |
49 | unsigned int irq, unsigned int dest, | 49 | extern void compose_remapped_msi_msg(struct pci_dev *pdev, |
50 | struct msi_msg *msg, u8 hpet_id); | 50 | unsigned int irq, unsigned int dest, |
51 | extern int intr_msi_alloc_irq(struct pci_dev *pdev, int irq, int nvec); | 51 | struct msi_msg *msg, u8 hpet_id); |
52 | extern int intr_msi_setup_irq(struct pci_dev *pdev, unsigned int irq, | 52 | extern int msi_alloc_remapped_irq(struct pci_dev *pdev, int irq, int nvec); |
53 | int index, int sub_handle); | 53 | extern int msi_setup_remapped_irq(struct pci_dev *pdev, unsigned int irq, |
54 | extern int intr_setup_hpet_msi(unsigned int irq, unsigned int id); | 54 | int index, int sub_handle); |
55 | extern int setup_hpet_msi_remapped(unsigned int irq, unsigned int id); | ||
55 | 56 | ||
56 | #else /* CONFIG_IRQ_REMAP */ | 57 | #else /* CONFIG_IRQ_REMAP */ |
57 | 58 | ||
58 | #define intr_remapping_enabled 0 | 59 | #define irq_remapping_enabled 0 |
59 | 60 | ||
60 | static inline void setup_intr_remapping(void) { } | 61 | static inline void setup_irq_remapping_ops(void) { } |
61 | static inline int intr_remapping_supported(void) { return 0; } | 62 | static inline int irq_remapping_supported(void) { return 0; } |
62 | static inline int intr_hardware_init(void) { return -ENODEV; } | 63 | static inline int irq_remapping_prepare(void) { return -ENODEV; } |
63 | static inline int intr_hardware_enable(void) { return -ENODEV; } | 64 | static inline int irq_remapping_enable(void) { return -ENODEV; } |
64 | static inline void intr_hardware_disable(void) { } | 65 | static inline void irq_remapping_disable(void) { } |
65 | static inline int intr_hardware_reenable(int eim) { return -ENODEV; } | 66 | static inline int irq_remapping_reenable(int eim) { return -ENODEV; } |
66 | static inline int intr_enable_fault_handling(void) { return -ENODEV; } | 67 | static inline int irq_remap_enable_fault_handling(void) { return -ENODEV; } |
67 | static inline int intr_setup_ioapic_entry(int irq, | 68 | static inline int setup_ioapic_remapped_entry(int irq, |
68 | struct IO_APIC_route_entry *entry, | 69 | struct IO_APIC_route_entry *entry, |
69 | unsigned int destination, int vector, | 70 | unsigned int destination, |
70 | struct io_apic_irq_attr *attr) | 71 | int vector, |
72 | struct io_apic_irq_attr *attr) | ||
71 | { | 73 | { |
72 | return -ENODEV; | 74 | return -ENODEV; |
73 | } | 75 | } |
74 | static inline int intr_set_affinity(struct irq_data *data, | 76 | static inline int set_remapped_irq_affinity(struct irq_data *data, |
75 | const struct cpumask *mask, | 77 | const struct cpumask *mask, |
76 | bool force) | 78 | bool force) |
77 | { | 79 | { |
78 | return 0; | 80 | return 0; |
79 | } | 81 | } |
80 | static inline void intr_free_irq(int irq) { } | 82 | static inline void free_remapped_irq(int irq) { } |
81 | static inline void intr_compose_msi_msg(struct pci_dev *pdev, | 83 | static inline void compose_remapped_msi_msg(struct pci_dev *pdev, |
82 | unsigned int irq, unsigned int dest, | 84 | unsigned int irq, unsigned int dest, |
83 | struct msi_msg *msg, u8 hpet_id) | 85 | struct msi_msg *msg, u8 hpet_id) |
84 | { | 86 | { |
85 | } | 87 | } |
86 | static inline int intr_msi_alloc_irq(struct pci_dev *pdev, int irq, int nvec) | 88 | static inline int msi_alloc_remapped_irq(struct pci_dev *pdev, int irq, int nvec) |
87 | { | 89 | { |
88 | return -ENODEV; | 90 | return -ENODEV; |
89 | } | 91 | } |
90 | static inline int intr_msi_setup_irq(struct pci_dev *pdev, unsigned int irq, | 92 | static inline int msi_setup_remapped_irq(struct pci_dev *pdev, unsigned int irq, |
91 | int index, int sub_handle) | 93 | int index, int sub_handle) |
92 | { | 94 | { |
93 | return -ENODEV; | 95 | return -ENODEV; |
94 | } | 96 | } |
95 | static inline int intr_setup_hpet_msi(unsigned int irq, unsigned int id) | 97 | static inline int setup_hpet_msi_remapped(unsigned int irq, unsigned int id) |
96 | { | 98 | { |
97 | return -ENODEV; | 99 | return -ENODEV; |
98 | } | 100 | } |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index a2762687e2ee..c02c666c4628 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -1442,8 +1442,8 @@ void __init bsp_end_local_APIC_setup(void) | |||
1442 | * Now that local APIC setup is completed for BP, configure the fault | 1442 | * Now that local APIC setup is completed for BP, configure the fault |
1443 | * handling for interrupt remapping. | 1443 | * handling for interrupt remapping. |
1444 | */ | 1444 | */ |
1445 | if (intr_remapping_enabled) | 1445 | if (irq_remapping_enabled) |
1446 | intr_enable_fault_handling(); | 1446 | irq_remap_enable_fault_handling(); |
1447 | 1447 | ||
1448 | } | 1448 | } |
1449 | 1449 | ||
@@ -1518,7 +1518,7 @@ void enable_x2apic(void) | |||
1518 | int __init enable_IR(void) | 1518 | int __init enable_IR(void) |
1519 | { | 1519 | { |
1520 | #ifdef CONFIG_IRQ_REMAP | 1520 | #ifdef CONFIG_IRQ_REMAP |
1521 | if (!intr_remapping_supported()) { | 1521 | if (!irq_remapping_supported()) { |
1522 | pr_debug("intr-remapping not supported\n"); | 1522 | pr_debug("intr-remapping not supported\n"); |
1523 | return -1; | 1523 | return -1; |
1524 | } | 1524 | } |
@@ -1529,7 +1529,7 @@ int __init enable_IR(void) | |||
1529 | return -1; | 1529 | return -1; |
1530 | } | 1530 | } |
1531 | 1531 | ||
1532 | return intr_hardware_enable(); | 1532 | return irq_remapping_enable(); |
1533 | #endif | 1533 | #endif |
1534 | return -1; | 1534 | return -1; |
1535 | } | 1535 | } |
@@ -1541,9 +1541,9 @@ void __init enable_IR_x2apic(void) | |||
1541 | int hardware_init_ret; | 1541 | int hardware_init_ret; |
1542 | 1542 | ||
1543 | /* Make sure irq_remap_ops are initialized */ | 1543 | /* Make sure irq_remap_ops are initialized */ |
1544 | setup_intr_remapping(); | 1544 | setup_irq_remapping_ops(); |
1545 | 1545 | ||
1546 | hardware_init_ret = intr_hardware_init(); | 1546 | hardware_init_ret = irq_remapping_prepare(); |
1547 | if (hardware_init_ret && !x2apic_supported()) | 1547 | if (hardware_init_ret && !x2apic_supported()) |
1548 | return; | 1548 | return; |
1549 | 1549 | ||
@@ -2180,8 +2180,8 @@ static int lapic_suspend(void) | |||
2180 | local_irq_save(flags); | 2180 | local_irq_save(flags); |
2181 | disable_local_APIC(); | 2181 | disable_local_APIC(); |
2182 | 2182 | ||
2183 | if (intr_remapping_enabled) | 2183 | if (irq_remapping_enabled) |
2184 | intr_hardware_disable(); | 2184 | irq_remapping_disable(); |
2185 | 2185 | ||
2186 | local_irq_restore(flags); | 2186 | local_irq_restore(flags); |
2187 | return 0; | 2187 | return 0; |
@@ -2197,7 +2197,7 @@ static void lapic_resume(void) | |||
2197 | return; | 2197 | return; |
2198 | 2198 | ||
2199 | local_irq_save(flags); | 2199 | local_irq_save(flags); |
2200 | if (intr_remapping_enabled) { | 2200 | if (irq_remapping_enabled) { |
2201 | /* | 2201 | /* |
2202 | * IO-APIC and PIC have their own resume routines. | 2202 | * IO-APIC and PIC have their own resume routines. |
2203 | * We just mask them here to make sure the interrupt | 2203 | * We just mask them here to make sure the interrupt |
@@ -2249,8 +2249,8 @@ static void lapic_resume(void) | |||
2249 | apic_write(APIC_ESR, 0); | 2249 | apic_write(APIC_ESR, 0); |
2250 | apic_read(APIC_ESR); | 2250 | apic_read(APIC_ESR); |
2251 | 2251 | ||
2252 | if (intr_remapping_enabled) | 2252 | if (irq_remapping_enabled) |
2253 | intr_hardware_reenable(x2apic_mode); | 2253 | irq_remapping_reenable(x2apic_mode); |
2254 | 2254 | ||
2255 | local_irq_restore(flags); | 2255 | local_irq_restore(flags); |
2256 | } | 2256 | } |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 073edd1d3c66..abbbcd4d1d71 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -1381,9 +1381,9 @@ static int setup_ioapic_entry(int irq, struct IO_APIC_route_entry *entry, | |||
1381 | unsigned int destination, int vector, | 1381 | unsigned int destination, int vector, |
1382 | struct io_apic_irq_attr *attr) | 1382 | struct io_apic_irq_attr *attr) |
1383 | { | 1383 | { |
1384 | if (intr_remapping_enabled) | 1384 | if (irq_remapping_enabled) |
1385 | return intr_setup_ioapic_entry(irq, entry, destination, | 1385 | return setup_ioapic_remapped_entry(irq, entry, destination, |
1386 | vector, attr); | 1386 | vector, attr); |
1387 | 1387 | ||
1388 | memset(entry, 0, sizeof(*entry)); | 1388 | memset(entry, 0, sizeof(*entry)); |
1389 | 1389 | ||
@@ -1540,7 +1540,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int ioapic_idx, | |||
1540 | { | 1540 | { |
1541 | struct IO_APIC_route_entry entry; | 1541 | struct IO_APIC_route_entry entry; |
1542 | 1542 | ||
1543 | if (intr_remapping_enabled) | 1543 | if (irq_remapping_enabled) |
1544 | return; | 1544 | return; |
1545 | 1545 | ||
1546 | memset(&entry, 0, sizeof(entry)); | 1546 | memset(&entry, 0, sizeof(entry)); |
@@ -1626,7 +1626,7 @@ __apicdebuginit(void) print_IO_APIC(int ioapic_idx) | |||
1626 | 1626 | ||
1627 | printk(KERN_DEBUG ".... IRQ redirection table:\n"); | 1627 | printk(KERN_DEBUG ".... IRQ redirection table:\n"); |
1628 | 1628 | ||
1629 | if (intr_remapping_enabled) { | 1629 | if (irq_remapping_enabled) { |
1630 | printk(KERN_DEBUG " NR Indx Fmt Mask Trig IRR" | 1630 | printk(KERN_DEBUG " NR Indx Fmt Mask Trig IRR" |
1631 | " Pol Stat Indx2 Zero Vect:\n"); | 1631 | " Pol Stat Indx2 Zero Vect:\n"); |
1632 | } else { | 1632 | } else { |
@@ -1635,7 +1635,7 @@ __apicdebuginit(void) print_IO_APIC(int ioapic_idx) | |||
1635 | } | 1635 | } |
1636 | 1636 | ||
1637 | for (i = 0; i <= reg_01.bits.entries; i++) { | 1637 | for (i = 0; i <= reg_01.bits.entries; i++) { |
1638 | if (intr_remapping_enabled) { | 1638 | if (irq_remapping_enabled) { |
1639 | struct IO_APIC_route_entry entry; | 1639 | struct IO_APIC_route_entry entry; |
1640 | struct IR_IO_APIC_route_entry *ir_entry; | 1640 | struct IR_IO_APIC_route_entry *ir_entry; |
1641 | 1641 | ||
@@ -2002,7 +2002,7 @@ void disable_IO_APIC(void) | |||
2002 | * IOAPIC RTE as well as interrupt-remapping table entry). | 2002 | * IOAPIC RTE as well as interrupt-remapping table entry). |
2003 | * As this gets called during crash dump, keep this simple for now. | 2003 | * As this gets called during crash dump, keep this simple for now. |
2004 | */ | 2004 | */ |
2005 | if (ioapic_i8259.pin != -1 && !intr_remapping_enabled) { | 2005 | if (ioapic_i8259.pin != -1 && !irq_remapping_enabled) { |
2006 | struct IO_APIC_route_entry entry; | 2006 | struct IO_APIC_route_entry entry; |
2007 | 2007 | ||
2008 | memset(&entry, 0, sizeof(entry)); | 2008 | memset(&entry, 0, sizeof(entry)); |
@@ -2026,7 +2026,7 @@ void disable_IO_APIC(void) | |||
2026 | * Use virtual wire A mode when interrupt remapping is enabled. | 2026 | * Use virtual wire A mode when interrupt remapping is enabled. |
2027 | */ | 2027 | */ |
2028 | if (cpu_has_apic || apic_from_smp_config()) | 2028 | if (cpu_has_apic || apic_from_smp_config()) |
2029 | disconnect_bsp_APIC(!intr_remapping_enabled && | 2029 | disconnect_bsp_APIC(!irq_remapping_enabled && |
2030 | ioapic_i8259.pin != -1); | 2030 | ioapic_i8259.pin != -1); |
2031 | } | 2031 | } |
2032 | 2032 | ||
@@ -2586,7 +2586,7 @@ static void irq_remap_modify_chip_defaults(struct irq_chip *chip) | |||
2586 | chip->irq_eoi = ir_ack_apic_level; | 2586 | chip->irq_eoi = ir_ack_apic_level; |
2587 | 2587 | ||
2588 | #ifdef CONFIG_SMP | 2588 | #ifdef CONFIG_SMP |
2589 | chip->irq_set_affinity = intr_set_affinity; | 2589 | chip->irq_set_affinity = set_remapped_irq_affinity; |
2590 | #endif | 2590 | #endif |
2591 | } | 2591 | } |
2592 | #endif /* CONFIG_IRQ_REMAP */ | 2592 | #endif /* CONFIG_IRQ_REMAP */ |
@@ -2799,7 +2799,7 @@ static inline void __init check_timer(void) | |||
2799 | * 8259A. | 2799 | * 8259A. |
2800 | */ | 2800 | */ |
2801 | if (pin1 == -1) { | 2801 | if (pin1 == -1) { |
2802 | if (intr_remapping_enabled) | 2802 | if (irq_remapping_enabled) |
2803 | panic("BIOS bug: timer not connected to IO-APIC"); | 2803 | panic("BIOS bug: timer not connected to IO-APIC"); |
2804 | pin1 = pin2; | 2804 | pin1 = pin2; |
2805 | apic1 = apic2; | 2805 | apic1 = apic2; |
@@ -2832,7 +2832,7 @@ static inline void __init check_timer(void) | |||
2832 | clear_IO_APIC_pin(0, pin1); | 2832 | clear_IO_APIC_pin(0, pin1); |
2833 | goto out; | 2833 | goto out; |
2834 | } | 2834 | } |
2835 | if (intr_remapping_enabled) | 2835 | if (irq_remapping_enabled) |
2836 | panic("timer doesn't work through Interrupt-remapped IO-APIC"); | 2836 | panic("timer doesn't work through Interrupt-remapped IO-APIC"); |
2837 | local_irq_disable(); | 2837 | local_irq_disable(); |
2838 | clear_IO_APIC_pin(apic1, pin1); | 2838 | clear_IO_APIC_pin(apic1, pin1); |
@@ -3056,7 +3056,7 @@ void destroy_irq(unsigned int irq) | |||
3056 | irq_set_status_flags(irq, IRQ_NOREQUEST|IRQ_NOPROBE); | 3056 | irq_set_status_flags(irq, IRQ_NOREQUEST|IRQ_NOPROBE); |
3057 | 3057 | ||
3058 | if (irq_remapped(cfg)) | 3058 | if (irq_remapped(cfg)) |
3059 | intr_free_irq(irq); | 3059 | free_remapped_irq(irq); |
3060 | raw_spin_lock_irqsave(&vector_lock, flags); | 3060 | raw_spin_lock_irqsave(&vector_lock, flags); |
3061 | __clear_irq_vector(irq, cfg); | 3061 | __clear_irq_vector(irq, cfg); |
3062 | raw_spin_unlock_irqrestore(&vector_lock, flags); | 3062 | raw_spin_unlock_irqrestore(&vector_lock, flags); |
@@ -3085,7 +3085,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, | |||
3085 | dest = apic->cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus()); | 3085 | dest = apic->cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus()); |
3086 | 3086 | ||
3087 | if (irq_remapped(cfg)) { | 3087 | if (irq_remapped(cfg)) { |
3088 | intr_compose_msi_msg(pdev, irq, dest, msg, hpet_id); | 3088 | compose_remapped_msi_msg(pdev, irq, dest, msg, hpet_id); |
3089 | return err; | 3089 | return err; |
3090 | } | 3090 | } |
3091 | 3091 | ||
@@ -3198,7 +3198,7 @@ int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
3198 | if (irq == 0) | 3198 | if (irq == 0) |
3199 | return -1; | 3199 | return -1; |
3200 | irq_want = irq + 1; | 3200 | irq_want = irq + 1; |
3201 | if (!intr_remapping_enabled) | 3201 | if (!irq_remapping_enabled) |
3202 | goto no_ir; | 3202 | goto no_ir; |
3203 | 3203 | ||
3204 | if (!sub_handle) { | 3204 | if (!sub_handle) { |
@@ -3206,13 +3206,14 @@ int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
3206 | * allocate the consecutive block of IRTE's | 3206 | * allocate the consecutive block of IRTE's |
3207 | * for 'nvec' | 3207 | * for 'nvec' |
3208 | */ | 3208 | */ |
3209 | index = intr_msi_alloc_irq(dev, irq, nvec); | 3209 | index = msi_alloc_remapped_irq(dev, irq, nvec); |
3210 | if (index < 0) { | 3210 | if (index < 0) { |
3211 | ret = index; | 3211 | ret = index; |
3212 | goto error; | 3212 | goto error; |
3213 | } | 3213 | } |
3214 | } else { | 3214 | } else { |
3215 | ret = intr_msi_setup_irq(dev, irq, index, sub_handle); | 3215 | ret = msi_setup_remapped_irq(dev, irq, index, |
3216 | sub_handle); | ||
3216 | if (ret < 0) | 3217 | if (ret < 0) |
3217 | goto error; | 3218 | goto error; |
3218 | } | 3219 | } |
@@ -3332,8 +3333,8 @@ int arch_setup_hpet_msi(unsigned int irq, unsigned int id) | |||
3332 | struct msi_msg msg; | 3333 | struct msi_msg msg; |
3333 | int ret; | 3334 | int ret; |
3334 | 3335 | ||
3335 | if (intr_remapping_enabled) { | 3336 | if (irq_remapping_enabled) { |
3336 | if (!intr_setup_hpet_msi(irq, id)) | 3337 | if (!setup_hpet_msi_remapped(irq, id)) |
3337 | return -1; | 3338 | return -1; |
3338 | } | 3339 | } |
3339 | 3340 | ||
@@ -3712,8 +3713,8 @@ void __init setup_ioapic_dest(void) | |||
3712 | else | 3713 | else |
3713 | mask = apic->target_cpus(); | 3714 | mask = apic->target_cpus(); |
3714 | 3715 | ||
3715 | if (intr_remapping_enabled) | 3716 | if (irq_remapping_enabled) |
3716 | intr_set_affinity(idata, mask, false); | 3717 | set_remapped_irq_affinity(idata, mask, false); |
3717 | else | 3718 | else |
3718 | ioapic_set_affinity(idata, mask, false); | 3719 | ioapic_set_affinity(idata, mask, false); |
3719 | } | 3720 | } |