diff options
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 25 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic.c | 43 | ||||
-rw-r--r-- | arch/x86/kernel/setup.c | 6 | ||||
-rw-r--r-- | include/asm-x86/io_apic.h | 8 | ||||
-rw-r--r-- | include/asm-x86/mpspec.h | 1 |
5 files changed, 41 insertions, 42 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 3e9d163fd92f..5fef4fece4a5 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -957,29 +957,6 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) | |||
957 | nr_ioapics++; | 957 | nr_ioapics++; |
958 | } | 958 | } |
959 | 959 | ||
960 | int get_nr_irqs_via_madt(void) | ||
961 | { | ||
962 | int idx; | ||
963 | int nr = 0; | ||
964 | |||
965 | for (idx = 0; idx < nr_ioapics; idx++) { | ||
966 | if (mp_ioapic_routing[idx].gsi_end > nr) | ||
967 | nr = mp_ioapic_routing[idx].gsi_end; | ||
968 | } | ||
969 | |||
970 | nr++; | ||
971 | |||
972 | /* double it for hotplug and msi and nmi */ | ||
973 | nr <<= 1; | ||
974 | |||
975 | /* something wrong ? */ | ||
976 | if (nr < 32) | ||
977 | nr = 32; | ||
978 | |||
979 | return nr; | ||
980 | |||
981 | } | ||
982 | |||
983 | static void assign_to_mp_irq(struct mp_config_intsrc *m, | 960 | static void assign_to_mp_irq(struct mp_config_intsrc *m, |
984 | struct mp_config_intsrc *mp_irq) | 961 | struct mp_config_intsrc *mp_irq) |
985 | { | 962 | { |
@@ -1278,8 +1255,6 @@ static int __init acpi_parse_madt_ioapic_entries(void) | |||
1278 | } | 1255 | } |
1279 | 1256 | ||
1280 | 1257 | ||
1281 | nr_irqs = get_nr_irqs_via_madt(); | ||
1282 | |||
1283 | count = | 1258 | count = |
1284 | acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, acpi_parse_int_src_ovr, | 1259 | acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, acpi_parse_int_src_ovr, |
1285 | nr_irqs); | 1260 | nr_irqs); |
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index f853b667fa5c..f7e80262cbbb 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c | |||
@@ -3596,6 +3596,36 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev) | |||
3596 | } | 3596 | } |
3597 | #endif /* CONFIG_HT_IRQ */ | 3597 | #endif /* CONFIG_HT_IRQ */ |
3598 | 3598 | ||
3599 | int __init io_apic_get_redir_entries (int ioapic) | ||
3600 | { | ||
3601 | union IO_APIC_reg_01 reg_01; | ||
3602 | unsigned long flags; | ||
3603 | |||
3604 | spin_lock_irqsave(&ioapic_lock, flags); | ||
3605 | reg_01.raw = io_apic_read(ioapic, 1); | ||
3606 | spin_unlock_irqrestore(&ioapic_lock, flags); | ||
3607 | |||
3608 | return reg_01.bits.entries; | ||
3609 | } | ||
3610 | |||
3611 | int __init probe_nr_irqs(void) | ||
3612 | { | ||
3613 | int idx; | ||
3614 | int nr = 0; | ||
3615 | |||
3616 | for (idx = 0; idx < nr_ioapics; idx++) | ||
3617 | nr += io_apic_get_redir_entries(idx); | ||
3618 | |||
3619 | /* double it for hotplug and msi and nmi */ | ||
3620 | nr <<= 1; | ||
3621 | |||
3622 | /* something wrong ? */ | ||
3623 | if (nr < 32) | ||
3624 | nr = 32; | ||
3625 | |||
3626 | return nr; | ||
3627 | } | ||
3628 | |||
3599 | /* -------------------------------------------------------------------------- | 3629 | /* -------------------------------------------------------------------------- |
3600 | ACPI-based IOAPIC Configuration | 3630 | ACPI-based IOAPIC Configuration |
3601 | -------------------------------------------------------------------------- */ | 3631 | -------------------------------------------------------------------------- */ |
@@ -3690,19 +3720,6 @@ int __init io_apic_get_version(int ioapic) | |||
3690 | } | 3720 | } |
3691 | #endif | 3721 | #endif |
3692 | 3722 | ||
3693 | int __init io_apic_get_redir_entries (int ioapic) | ||
3694 | { | ||
3695 | union IO_APIC_reg_01 reg_01; | ||
3696 | unsigned long flags; | ||
3697 | |||
3698 | spin_lock_irqsave(&ioapic_lock, flags); | ||
3699 | reg_01.raw = io_apic_read(ioapic, 1); | ||
3700 | spin_unlock_irqrestore(&ioapic_lock, flags); | ||
3701 | |||
3702 | return reg_01.bits.entries; | ||
3703 | } | ||
3704 | |||
3705 | |||
3706 | int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int polarity) | 3723 | int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int polarity) |
3707 | { | 3724 | { |
3708 | if (!IO_APIC_IRQ(irq)) { | 3725 | if (!IO_APIC_IRQ(irq)) { |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index d90c659b70e9..61335306696a 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -1069,15 +1069,15 @@ void __init setup_arch(char **cmdline_p) | |||
1069 | prefill_possible_map(); | 1069 | prefill_possible_map(); |
1070 | 1070 | ||
1071 | #ifdef CONFIG_X86_64 | 1071 | #ifdef CONFIG_X86_64 |
1072 | /* need to wait for nr_cpu_ids settle down */ | ||
1073 | if (nr_irqs == NR_IRQS) | ||
1074 | nr_irqs = 32 * nr_cpu_ids + 224; | ||
1075 | init_cpu_to_node(); | 1072 | init_cpu_to_node(); |
1076 | #endif | 1073 | #endif |
1077 | 1074 | ||
1078 | init_apic_mappings(); | 1075 | init_apic_mappings(); |
1079 | ioapic_init_mappings(); | 1076 | ioapic_init_mappings(); |
1080 | 1077 | ||
1078 | /* need to wait for io_apic is mapped */ | ||
1079 | nr_irqs = probe_nr_irqs(); | ||
1080 | |||
1081 | kvm_guest_init(); | 1081 | kvm_guest_init(); |
1082 | 1082 | ||
1083 | e820_reserve_resources(); | 1083 | e820_reserve_resources(); |
diff --git a/include/asm-x86/io_apic.h b/include/asm-x86/io_apic.h index ce818292d2c7..d35cbd7aa587 100644 --- a/include/asm-x86/io_apic.h +++ b/include/asm-x86/io_apic.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <asm/mpspec.h> | 5 | #include <asm/mpspec.h> |
6 | #include <asm/apicdef.h> | 6 | #include <asm/apicdef.h> |
7 | #include <asm/irq_vectors.h> | ||
7 | 8 | ||
8 | /* | 9 | /* |
9 | * Intel IO-APIC support for SMP and UP systems. | 10 | * Intel IO-APIC support for SMP and UP systems. |
@@ -187,10 +188,17 @@ extern void restore_IO_APIC_setup(void); | |||
187 | extern void reinit_intr_remapped_IO_APIC(int); | 188 | extern void reinit_intr_remapped_IO_APIC(int); |
188 | #endif | 189 | #endif |
189 | 190 | ||
191 | extern int probe_nr_irqs(void); | ||
192 | |||
190 | #else /* !CONFIG_X86_IO_APIC */ | 193 | #else /* !CONFIG_X86_IO_APIC */ |
191 | #define io_apic_assign_pci_irqs 0 | 194 | #define io_apic_assign_pci_irqs 0 |
192 | static const int timer_through_8259 = 0; | 195 | static const int timer_through_8259 = 0; |
193 | static inline void ioapic_init_mappings(void) { } | 196 | static inline void ioapic_init_mappings(void) { } |
197 | |||
198 | static inline int probe_nr_irqs(void) | ||
199 | { | ||
200 | return NR_IRQS; | ||
201 | } | ||
194 | #endif | 202 | #endif |
195 | 203 | ||
196 | #endif /* ASM_X86__IO_APIC_H */ | 204 | #endif /* ASM_X86__IO_APIC_H */ |
diff --git a/include/asm-x86/mpspec.h b/include/asm-x86/mpspec.h index a0748021250b..be2241a818f1 100644 --- a/include/asm-x86/mpspec.h +++ b/include/asm-x86/mpspec.h | |||
@@ -60,7 +60,6 @@ extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, | |||
60 | u32 gsi); | 60 | u32 gsi); |
61 | extern void mp_config_acpi_legacy_irqs(void); | 61 | extern void mp_config_acpi_legacy_irqs(void); |
62 | extern int mp_register_gsi(u32 gsi, int edge_level, int active_high_low); | 62 | extern int mp_register_gsi(u32 gsi, int edge_level, int active_high_low); |
63 | extern int get_nr_irqs_via_madt(void); | ||
64 | #ifdef CONFIG_X86_IO_APIC | 63 | #ifdef CONFIG_X86_IO_APIC |
65 | extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, | 64 | extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, |
66 | u32 gsi, int triggering, int polarity); | 65 | u32 gsi, int triggering, int polarity); |