aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/irqinit.c
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@suse.com>2014-11-03 03:39:43 -0500
committerThomas Gleixner <tglx@linutronix.de>2014-12-16 08:08:14 -0500
commit2414e021ac8d588f1b09f64891f69a3e26feadf1 (patch)
treeb74763cf043cd03720f371141a0a77c3baf6369f /arch/x86/kernel/irqinit.c
parente10679825924580845c4825deaaddf5331ff627c (diff)
x86: Avoid building unused IRQ entry stubs
When X86_LOCAL_APIC (i.e. unconditionally on x86-64), first_system_vector will never end up being higher than LOCAL_TIMER_VECTOR (0xef), and hence building stubs for vectors 0xef...0xff is pointlessly reducing code density. Deal with this at build time already. Taking into consideration that X86_64 implies X86_LOCAL_APIC, also simplify (and hence make easier to read and more consistent with the change done here) some #if-s in arch/x86/kernel/irqinit.c. While we could further improve the packing of the IRQ entry stubs (the four ones now left in the last set could be fit into the four padding bytes each of the final four sets have) this doesn't seem to provide any real benefit: Both irq_entries_start and common_interrupt getting cache line aligned, eliminating the 30th set would just produce 32 bytes of padding between the 29th and common_interrupt. [ tglx: Folded lguest fix from Dan Carpenter ] Signed-off-by: Jan Beulich <jbeulich@suse.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: lguest@lists.ozlabs.org Cc: Rusty Russell <rusty@rustcorp.com.au> Link: http://lkml.kernel.org/r/54574D5F0200007800044389@mail.emea.novell.com Link: http://lkml.kernel.org/r/20141115185718.GB6530@mwanda Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/irqinit.c')
-rw-r--r--arch/x86/kernel/irqinit.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index 4de73ee78361..fa893087fb51 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -124,7 +124,6 @@ void setup_vector_irq(int cpu)
124static void __init smp_intr_init(void) 124static void __init smp_intr_init(void)
125{ 125{
126#ifdef CONFIG_SMP 126#ifdef CONFIG_SMP
127#if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC)
128 /* 127 /*
129 * The reschedule interrupt is a CPU-to-CPU reschedule-helper 128 * The reschedule interrupt is a CPU-to-CPU reschedule-helper
130 * IPI, driven by wakeup. 129 * IPI, driven by wakeup.
@@ -144,7 +143,6 @@ static void __init smp_intr_init(void)
144 143
145 /* IPI used for rebooting/stopping */ 144 /* IPI used for rebooting/stopping */
146 alloc_intr_gate(REBOOT_VECTOR, reboot_interrupt); 145 alloc_intr_gate(REBOOT_VECTOR, reboot_interrupt);
147#endif
148#endif /* CONFIG_SMP */ 146#endif /* CONFIG_SMP */
149} 147}
150 148
@@ -159,7 +157,7 @@ static void __init apic_intr_init(void)
159 alloc_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt); 157 alloc_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt);
160#endif 158#endif
161 159
162#if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC) 160#ifdef CONFIG_X86_LOCAL_APIC
163 /* self generated IPI for local APIC timer */ 161 /* self generated IPI for local APIC timer */
164 alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); 162 alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
165 163
@@ -197,10 +195,17 @@ void __init native_init_IRQ(void)
197 * 'special' SMP interrupts) 195 * 'special' SMP interrupts)
198 */ 196 */
199 i = FIRST_EXTERNAL_VECTOR; 197 i = FIRST_EXTERNAL_VECTOR;
200 for_each_clear_bit_from(i, used_vectors, NR_VECTORS) { 198#ifndef CONFIG_X86_LOCAL_APIC
199#define first_system_vector NR_VECTORS
200#endif
201 for_each_clear_bit_from(i, used_vectors, first_system_vector) {
201 /* IA32_SYSCALL_VECTOR could be used in trap_init already. */ 202 /* IA32_SYSCALL_VECTOR could be used in trap_init already. */
202 set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]); 203 set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]);
203 } 204 }
205#ifdef CONFIG_X86_LOCAL_APIC
206 for_each_clear_bit_from(i, used_vectors, NR_VECTORS)
207 set_intr_gate(i, spurious_interrupt);
208#endif
204 209
205 if (!acpi_ioapic && !of_ioapic && nr_legacy_irqs()) 210 if (!acpi_ioapic && !of_ioapic && nr_legacy_irqs())
206 setup_irq(2, &irq2); 211 setup_irq(2, &irq2);