diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2015-08-04 00:32:56 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-08-05 18:14:58 -0400 |
commit | ad3f8d5afe503faa78d61a50a1f6eec3afa7c787 (patch) | |
tree | 4e0a650585971bd73417595529ef9d954338a079 /arch/x86/lguest/boot.c | |
parent | 27a6f41c1a20a3339f456647a21e45fca5b82b62 (diff) |
x86/lguest: Do not setup unused irq vectors
No point in assigning the interrupt vectors if there is no interrupt
chip installed. Move it to lguest_setup_irq() and call it from
lguest_enable_irq.
[ rusty: Typo fix and error handling ]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Link: http://lkml.kernel.org/r/1438662776-4823-2-git-send-email-rusty@rustcorp.com.au
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/lguest/boot.c')
-rw-r--r-- | arch/x86/lguest/boot.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index d933a11ceba6..2165f45befff 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -850,21 +850,29 @@ static int lguest_setup_irq(unsigned int irq) | |||
850 | if (err < 0 && err != -EEXIST) | 850 | if (err < 0 && err != -EEXIST) |
851 | return err; | 851 | return err; |
852 | 852 | ||
853 | /* | ||
854 | * Tell the Linux infrastructure that the interrupt is | ||
855 | * controlled by our level-based lguest interrupt controller. | ||
856 | */ | ||
853 | irq_set_chip_and_handler_name(irq, &lguest_irq_controller, | 857 | irq_set_chip_and_handler_name(irq, &lguest_irq_controller, |
854 | handle_level_irq, "level"); | 858 | handle_level_irq, "level"); |
859 | |||
860 | /* Some systems map "vectors" to interrupts weirdly. Not us! */ | ||
861 | __this_cpu_write(vector_irq[FIRST_EXTERNAL_VECTOR + irq], irq); | ||
855 | return 0; | 862 | return 0; |
856 | } | 863 | } |
857 | 864 | ||
858 | static int lguest_enable_irq(struct pci_dev *dev) | 865 | static int lguest_enable_irq(struct pci_dev *dev) |
859 | { | 866 | { |
867 | int err; | ||
860 | u8 line = 0; | 868 | u8 line = 0; |
861 | 869 | ||
862 | /* We literally use the PCI interrupt line as the irq number. */ | 870 | /* We literally use the PCI interrupt line as the irq number. */ |
863 | pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &line); | 871 | pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &line); |
864 | irq_set_chip_and_handler_name(line, &lguest_irq_controller, | 872 | err = lguest_setup_irq(line); |
865 | handle_level_irq, "level"); | 873 | if (!err) |
866 | dev->irq = line; | 874 | dev->irq = line; |
867 | return 0; | 875 | return err; |
868 | } | 876 | } |
869 | 877 | ||
870 | /* We don't do hotplug PCI, so this shouldn't be called. */ | 878 | /* We don't do hotplug PCI, so this shouldn't be called. */ |
@@ -875,17 +883,13 @@ static void lguest_disable_irq(struct pci_dev *dev) | |||
875 | 883 | ||
876 | /* | 884 | /* |
877 | * This sets up the Interrupt Descriptor Table (IDT) entry for each hardware | 885 | * This sets up the Interrupt Descriptor Table (IDT) entry for each hardware |
878 | * interrupt (except 128, which is used for system calls), and then tells the | 886 | * interrupt (except 128, which is used for system calls). |
879 | * Linux infrastructure that each interrupt is controlled by our level-based | ||
880 | * lguest interrupt controller. | ||
881 | */ | 887 | */ |
882 | static void __init lguest_init_IRQ(void) | 888 | static void __init lguest_init_IRQ(void) |
883 | { | 889 | { |
884 | unsigned int i; | 890 | unsigned int i; |
885 | 891 | ||
886 | for (i = FIRST_EXTERNAL_VECTOR; i < FIRST_SYSTEM_VECTOR; i++) { | 892 | for (i = FIRST_EXTERNAL_VECTOR; i < FIRST_SYSTEM_VECTOR; i++) { |
887 | /* Some systems map "vectors" to interrupts weirdly. Not us! */ | ||
888 | __this_cpu_write(vector_irq[i], i - FIRST_EXTERNAL_VECTOR); | ||
889 | if (i != IA32_SYSCALL_VECTOR) | 893 | if (i != IA32_SYSCALL_VECTOR) |
890 | set_intr_gate(i, irq_entries_start + | 894 | set_intr_gate(i, irq_entries_start + |
891 | 8 * (i - FIRST_EXTERNAL_VECTOR)); | 895 | 8 * (i - FIRST_EXTERNAL_VECTOR)); |