diff options
-rw-r--r-- | arch/x86/kernel/irqinit_32.c | 56 | ||||
-rw-r--r-- | arch/x86/kernel/irqinit_64.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/traps.c | 15 |
3 files changed, 43 insertions, 35 deletions
diff --git a/arch/x86/kernel/irqinit_32.c b/arch/x86/kernel/irqinit_32.c index c56496f8c6fc..ddf3eb72f864 100644 --- a/arch/x86/kernel/irqinit_32.c +++ b/arch/x86/kernel/irqinit_32.c | |||
@@ -120,28 +120,8 @@ int vector_used_by_percpu_irq(unsigned int vector) | |||
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | 122 | ||
123 | /* Overridden in paravirt.c */ | 123 | static void __init smp_intr_init(void) |
124 | void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ"))); | ||
125 | |||
126 | void __init native_init_IRQ(void) | ||
127 | { | 124 | { |
128 | int i; | ||
129 | |||
130 | /* all the set up before the call gates are initialised */ | ||
131 | pre_intr_init_hook(); | ||
132 | |||
133 | /* | ||
134 | * Cover the whole vector space, no vector can escape | ||
135 | * us. (some of these will be overridden and become | ||
136 | * 'special' SMP interrupts) | ||
137 | */ | ||
138 | for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) { | ||
139 | /* SYSCALL_VECTOR was reserved in trap_init. */ | ||
140 | if (i != SYSCALL_VECTOR) | ||
141 | set_intr_gate(i, interrupt[i-FIRST_EXTERNAL_VECTOR]); | ||
142 | } | ||
143 | |||
144 | |||
145 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_SMP) | 125 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_SMP) |
146 | /* | 126 | /* |
147 | * The reschedule interrupt is a CPU-to-CPU reschedule-helper | 127 | * The reschedule interrupt is a CPU-to-CPU reschedule-helper |
@@ -170,8 +150,13 @@ void __init native_init_IRQ(void) | |||
170 | set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt); | 150 | set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt); |
171 | set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors); | 151 | set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors); |
172 | #endif | 152 | #endif |
153 | } | ||
173 | 154 | ||
155 | static void __init apic_intr_init(void) | ||
156 | { | ||
174 | #ifdef CONFIG_X86_LOCAL_APIC | 157 | #ifdef CONFIG_X86_LOCAL_APIC |
158 | smp_intr_init(); | ||
159 | |||
175 | /* self generated IPI for local APIC timer */ | 160 | /* self generated IPI for local APIC timer */ |
176 | alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); | 161 | alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); |
177 | 162 | ||
@@ -181,12 +166,37 @@ void __init native_init_IRQ(void) | |||
181 | # ifdef CONFIG_PERF_COUNTERS | 166 | # ifdef CONFIG_PERF_COUNTERS |
182 | alloc_intr_gate(LOCAL_PERF_VECTOR, perf_counter_interrupt); | 167 | alloc_intr_gate(LOCAL_PERF_VECTOR, perf_counter_interrupt); |
183 | # endif | 168 | # endif |
184 | #endif | ||
185 | 169 | ||
186 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_MCE_P4THERMAL) | 170 | # ifdef CONFIG_X86_MCE_P4THERMAL |
187 | /* thermal monitor LVT interrupt */ | 171 | /* thermal monitor LVT interrupt */ |
188 | alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); | 172 | alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); |
173 | # endif | ||
189 | #endif | 174 | #endif |
175 | } | ||
176 | |||
177 | /* Overridden in paravirt.c */ | ||
178 | void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ"))); | ||
179 | |||
180 | void __init native_init_IRQ(void) | ||
181 | { | ||
182 | int i; | ||
183 | |||
184 | /* all the set up before the call gates are initialised */ | ||
185 | pre_intr_init_hook(); | ||
186 | |||
187 | apic_intr_init(); | ||
188 | |||
189 | /* | ||
190 | * Cover the whole vector space, no vector can escape | ||
191 | * us. (some of these will be overridden and become | ||
192 | * 'special' SMP interrupts) | ||
193 | */ | ||
194 | for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) { | ||
195 | int vector = FIRST_EXTERNAL_VECTOR + i; | ||
196 | /* SYSCALL_VECTOR was reserved in trap_init. */ | ||
197 | if (!test_bit(vector, used_vectors)) | ||
198 | set_intr_gate(vector, interrupt[i]); | ||
199 | } | ||
190 | 200 | ||
191 | if (!acpi_ioapic) | 201 | if (!acpi_ioapic) |
192 | setup_irq(2, &irq2); | 202 | setup_irq(2, &irq2); |
diff --git a/arch/x86/kernel/irqinit_64.c b/arch/x86/kernel/irqinit_64.c index 6a71bfc51e51..16e1fc687504 100644 --- a/arch/x86/kernel/irqinit_64.c +++ b/arch/x86/kernel/irqinit_64.c | |||
@@ -162,6 +162,9 @@ void __init native_init_IRQ(void) | |||
162 | int i; | 162 | int i; |
163 | 163 | ||
164 | init_ISA_irqs(); | 164 | init_ISA_irqs(); |
165 | |||
166 | apic_intr_init(); | ||
167 | |||
165 | /* | 168 | /* |
166 | * Cover the whole vector space, no vector can escape | 169 | * Cover the whole vector space, no vector can escape |
167 | * us. (some of these will be overridden and become | 170 | * us. (some of these will be overridden and become |
@@ -169,12 +172,10 @@ void __init native_init_IRQ(void) | |||
169 | */ | 172 | */ |
170 | for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) { | 173 | for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) { |
171 | int vector = FIRST_EXTERNAL_VECTOR + i; | 174 | int vector = FIRST_EXTERNAL_VECTOR + i; |
172 | if (vector != IA32_SYSCALL_VECTOR) | 175 | if (!test_bit(vector, used_vectors)) |
173 | set_intr_gate(vector, interrupt[i]); | 176 | set_intr_gate(vector, interrupt[i]); |
174 | } | 177 | } |
175 | 178 | ||
176 | apic_intr_init(); | ||
177 | |||
178 | if (!acpi_ioapic) | 179 | if (!acpi_ioapic) |
179 | setup_irq(2, &irq2); | 180 | setup_irq(2, &irq2); |
180 | } | 181 | } |
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index ed5aee5f3fcc..d36a502d87ab 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -979,8 +979,13 @@ void __init trap_init(void) | |||
979 | #endif | 979 | #endif |
980 | set_intr_gate(19, &simd_coprocessor_error); | 980 | set_intr_gate(19, &simd_coprocessor_error); |
981 | 981 | ||
982 | /* Reserve all the builtin and the syscall vector: */ | ||
983 | for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++) | ||
984 | set_bit(i, used_vectors); | ||
985 | |||
982 | #ifdef CONFIG_IA32_EMULATION | 986 | #ifdef CONFIG_IA32_EMULATION |
983 | set_system_intr_gate(IA32_SYSCALL_VECTOR, ia32_syscall); | 987 | set_system_intr_gate(IA32_SYSCALL_VECTOR, ia32_syscall); |
988 | set_bit(IA32_SYSCALL_VECTOR, used_vectors); | ||
984 | #endif | 989 | #endif |
985 | 990 | ||
986 | #ifdef CONFIG_X86_32 | 991 | #ifdef CONFIG_X86_32 |
@@ -997,17 +1002,9 @@ void __init trap_init(void) | |||
997 | } | 1002 | } |
998 | 1003 | ||
999 | set_system_trap_gate(SYSCALL_VECTOR, &system_call); | 1004 | set_system_trap_gate(SYSCALL_VECTOR, &system_call); |
1000 | #endif | ||
1001 | |||
1002 | /* Reserve all the builtin and the syscall vector: */ | ||
1003 | for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++) | ||
1004 | set_bit(i, used_vectors); | ||
1005 | |||
1006 | #ifdef CONFIG_X86_64 | ||
1007 | set_bit(IA32_SYSCALL_VECTOR, used_vectors); | ||
1008 | #else | ||
1009 | set_bit(SYSCALL_VECTOR, used_vectors); | 1005 | set_bit(SYSCALL_VECTOR, used_vectors); |
1010 | #endif | 1006 | #endif |
1007 | |||
1011 | /* | 1008 | /* |
1012 | * Should be a barrier for any external CPU state: | 1009 | * Should be a barrier for any external CPU state: |
1013 | */ | 1010 | */ |