* [PATCH -tip] x86: apic interrupts - move assignments to irqinit_32.c
@ 2008-08-08 19:50 Cyrill Gorcunov
2008-08-11 12:57 ` Ingo Molnar
0 siblings, 1 reply; 4+ messages in thread
From: Cyrill Gorcunov @ 2008-08-08 19:50 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Andi Kleen,
Maciej W. Rozycki
Cc: Yinghai Lu, LKML
64bit mode APIC interrupt handlers are set within irqinit_64.c.
Lets do tha same for 32bit mode which would help in furter code merging.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
I found it useful for APIC code merging process (in which
i'm now). So please review and test if possible.
Any comments are quite welcome!
Ugh... almost forget - the patch is over -tip tree
commit 62c67a7cc7dbd9c8d92d49cfd7d5ca1d8f354616
arch/x86/kernel/apic_32.c | 48 -----------------------------------------
arch/x86/kernel/irqinit_32.c | 49 +++++++++++++++++++++++++++++++++++++++++-
arch/x86/mach-default/setup.c | 15 ------------
include/asm-x86/arch_hooks.h | 2 -
4 files changed, 48 insertions(+), 66 deletions(-)
Index: linux-2.6.git/arch/x86/kernel/apic_32.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic_32.c 2008-08-08 23:12:23.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/apic_32.c 2008-08-08 23:14:21.000000000 +0400
@@ -1366,54 +1366,6 @@ void smp_error_interrupt(struct pt_regs
irq_exit();
}
-#ifdef CONFIG_SMP
-void __init smp_intr_init(void)
-{
- /*
- * IRQ0 must be given a fixed assignment and initialized,
- * because it's used before the IO-APIC is set up.
- */
- set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]);
-
- /*
- * The reschedule interrupt is a CPU-to-CPU reschedule-helper
- * IPI, driven by wakeup.
- */
- alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt);
-
- /* IPI for invalidation */
- alloc_intr_gate(INVALIDATE_TLB_VECTOR, invalidate_interrupt);
-
- /* IPI for generic function call */
- alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt);
-
- /* IPI for single call function */
- set_intr_gate(CALL_FUNCTION_SINGLE_VECTOR,
- call_function_single_interrupt);
-}
-#endif
-
-/*
- * Initialize APIC interrupts
- */
-void __init apic_intr_init(void)
-{
-#ifdef CONFIG_SMP
- smp_intr_init();
-#endif
- /* self generated IPI for local APIC timer */
- alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
-
- /* IPI vectors for APIC spurious and error interrupts */
- alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
- alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
-
- /* thermal monitor LVT interrupt */
-#ifdef CONFIG_X86_MCE_P4THERMAL
- alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt);
-#endif
-}
-
/**
* connect_bsp_APIC - attach the APIC to the interrupt system
*/
Index: linux-2.6.git/arch/x86/kernel/irqinit_32.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/irqinit_32.c 2008-08-08 23:12:23.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/irqinit_32.c 2008-08-08 23:18:33.000000000 +0400
@@ -98,6 +98,46 @@ void __init native_init_IRQ(void)
set_intr_gate(vector, interrupt[i]);
}
+#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_SMP)
+ /*
+ * IRQ0 must be given a fixed assignment and initialized,
+ * because it's used before the IO-APIC is set up.
+ */
+ set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]);
+
+ /*
+ * The reschedule interrupt is a CPU-to-CPU reschedule-helper
+ * IPI, driven by wakeup.
+ */
+ alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt);
+
+ /* IPI for invalidation */
+ alloc_intr_gate(INVALIDATE_TLB_VECTOR, invalidate_interrupt);
+
+ /* IPI for generic function call */
+ alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt);
+
+ /* IPI for single call function */
+ set_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, call_function_single_interrupt);
+#endif
+
+#ifdef CONFIG_X86_LOCAL_APIC
+ /* self generated IPI for local APIC timer */
+ alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
+
+ /* IPI vectors for APIC spurious and error interrupts */
+ alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
+ alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
+#endif
+
+#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_MCE_P4THERMAL)
+ /* thermal monitor LVT interrupt */
+ alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt);
+#endif
+
+ if (!acpi_ioapic)
+ setup_irq(2, &irq2);
+
/* setup after call gates are initialised (usually add in
* the architecture specific gates)
*/
Index: linux-2.6.git/include/asm-x86/arch_hooks.h
===================================================================
--- linux-2.6.git.orig/include/asm-x86/arch_hooks.h 2008-08-08 23:12:23.000000000 +0400
+++ linux-2.6.git/include/asm-x86/arch_hooks.h 2008-08-08 23:14:21.000000000 +0400
@@ -12,8 +12,6 @@
/* these aren't arch hooks, they are generic routines
* that can be used by the hooks */
extern void init_ISA_irqs(void);
-extern void apic_intr_init(void);
-extern void smp_intr_init(void);
extern irqreturn_t timer_interrupt(int irq, void *dev_id);
/* these are the defined hooks */
Index: linux-2.6.git/arch/x86/mach-default/setup.c
===================================================================
--- linux-2.6.git.orig/arch/x86/mach-default/setup.c 2008-08-08 23:12:23.000000000 +0400
+++ linux-2.6.git/arch/x86/mach-default/setup.c 2008-08-08 23:18:57.000000000 +0400
@@ -62,12 +62,6 @@ void __init intr_init_hook(void)
if (x86_quirks->arch_intr_init())
return;
}
-#ifdef CONFIG_X86_LOCAL_APIC
- apic_intr_init();
-#endif
-
- if (!acpi_ioapic)
- setup_irq(2, &irq2);
}
/**
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH -tip] x86: apic interrupts - move assignments to irqinit_32.c 2008-08-08 19:50 [PATCH -tip] x86: apic interrupts - move assignments to irqinit_32.c Cyrill Gorcunov @ 2008-08-11 12:57 ` Ingo Molnar 2008-08-11 13:06 ` Ingo Molnar 0 siblings, 1 reply; 4+ messages in thread From: Ingo Molnar @ 2008-08-11 12:57 UTC (permalink / raw) To: Cyrill Gorcunov Cc: Thomas Gleixner, H. Peter Anvin, Andi Kleen, Maciej W. Rozycki, Yinghai Lu, LKML * Cyrill Gorcunov <gorcunov@gmail.com> wrote: > 64bit mode APIC interrupt handlers are set within irqinit_64.c. > Lets do tha same for 32bit mode which would help in furter code merging. > > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> > --- > > I found it useful for APIC code merging process (in which > i'm now). So please review and test if possible. > Any comments are quite welcome! > > Ugh... almost forget - the patch is over -tip tree > commit 62c67a7cc7dbd9c8d92d49cfd7d5ca1d8f354616 applied to tip/x86/core for more testing, thanks Cyrill. Ingo ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -tip] x86: apic interrupts - move assignments to irqinit_32.c 2008-08-11 12:57 ` Ingo Molnar @ 2008-08-11 13:06 ` Ingo Molnar 2008-08-11 14:34 ` Cyrill Gorcunov 0 siblings, 1 reply; 4+ messages in thread From: Ingo Molnar @ 2008-08-11 13:06 UTC (permalink / raw) To: Cyrill Gorcunov Cc: Thomas Gleixner, H. Peter Anvin, Andi Kleen, Maciej W. Rozycki, Yinghai Lu, LKML * Ingo Molnar <mingo@elte.hu> wrote: > * Cyrill Gorcunov <gorcunov@gmail.com> wrote: > > > 64bit mode APIC interrupt handlers are set within irqinit_64.c. > > Lets do tha same for 32bit mode which would help in furter code merging. > > > > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> > > --- > > > > I found it useful for APIC code merging process (in which > > i'm now). So please review and test if possible. > > Any comments are quite welcome! > > > > Ugh... almost forget - the patch is over -tip tree > > commit 62c67a7cc7dbd9c8d92d49cfd7d5ca1d8f354616 > > applied to tip/x86/core for more testing, thanks Cyrill. doesnt build: arch/x86/mach-default/setup.c:44: warning: ‘irq2’ defined but not used arch/x86/kernel/irqinit_32.c: In function ‘native_init_IRQ’: arch/x86/kernel/irqinit_32.c:139: error: ‘irq2’ undeclared (first use in this function) arch/x86/kernel/irqinit_32.c:139: error: (Each undeclared identifier is reported only once arch/x86/kernel/irqinit_32.c:139: error: for each function it appears in.) with: http://redhat.com/~mingo/misc/config-Mon_Aug_11_14_48_29_CEST_2008.bad Ingo ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -tip] x86: apic interrupts - move assignments to irqinit_32.c 2008-08-11 13:06 ` Ingo Molnar @ 2008-08-11 14:34 ` Cyrill Gorcunov 0 siblings, 0 replies; 4+ messages in thread From: Cyrill Gorcunov @ 2008-08-11 14:34 UTC (permalink / raw) To: Ingo Molnar Cc: Thomas Gleixner, H. Peter Anvin, Andi Kleen, Maciej W. Rozycki, Yinghai Lu, LKML [Ingo Molnar - Mon, Aug 11, 2008 at 03:06:47PM +0200] | | * Ingo Molnar <mingo@elte.hu> wrote: | | > * Cyrill Gorcunov <gorcunov@gmail.com> wrote: | > | > > 64bit mode APIC interrupt handlers are set within irqinit_64.c. | > > Lets do tha same for 32bit mode which would help in furter code merging. | > > | > > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> | > > --- | > > | > > I found it useful for APIC code merging process (in which | > > i'm now). So please review and test if possible. | > > Any comments are quite welcome! | > > | > > Ugh... almost forget - the patch is over -tip tree | > > commit 62c67a7cc7dbd9c8d92d49cfd7d5ca1d8f354616 | > | > applied to tip/x86/core for more testing, thanks Cyrill. | | doesnt build: | | arch/x86/mach-default/setup.c:44: warning: ‘irq2’ defined but not used | arch/x86/kernel/irqinit_32.c: In function ‘native_init_IRQ’: | arch/x86/kernel/irqinit_32.c:139: error: ‘irq2’ undeclared (first use in this function) | arch/x86/kernel/irqinit_32.c:139: error: (Each undeclared identifier is reported only once | arch/x86/kernel/irqinit_32.c:139: error: for each function it appears in.) | | with: | | http://redhat.com/~mingo/misc/config-Mon_Aug_11_14_48_29_CEST_2008.bad | | Ingo | Sorry, Ingo, for that. Here is an updated version. Could you please update it? - Cyrill - --- From: Cyrill Gorcunov <gorcunov@gmail.com> Subject: [PATCH -tip] x86: apic interrupts - move assignments to irqinit_32.c v2 64bit mode APIC interrupt handlers are set within irqinit_64.c. Lets do tha same for 32bit mode which would help in furter code merging. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> --- The patch is on top of 62c67a7cc7dbd9c8d92d49cfd7d5ca1d8f354616 -tip tree. Index: linux-2.6.git/arch/x86/kernel/apic_32.c =================================================================== --- linux-2.6.git.orig/arch/x86/kernel/apic_32.c 2008-08-11 18:16:22.000000000 +0400 +++ linux-2.6.git/arch/x86/kernel/apic_32.c 2008-08-11 18:18:13.000000000 +0400 @@ -1366,54 +1366,6 @@ void smp_error_interrupt(struct pt_regs irq_exit(); } -#ifdef CONFIG_SMP -void __init smp_intr_init(void) -{ - /* - * IRQ0 must be given a fixed assignment and initialized, - * because it's used before the IO-APIC is set up. - */ - set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]); - - /* - * The reschedule interrupt is a CPU-to-CPU reschedule-helper - * IPI, driven by wakeup. - */ - alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt); - - /* IPI for invalidation */ - alloc_intr_gate(INVALIDATE_TLB_VECTOR, invalidate_interrupt); - - /* IPI for generic function call */ - alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt); - - /* IPI for single call function */ - set_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, - call_function_single_interrupt); -} -#endif - -/* - * Initialize APIC interrupts - */ -void __init apic_intr_init(void) -{ -#ifdef CONFIG_SMP - smp_intr_init(); -#endif - /* self generated IPI for local APIC timer */ - alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); - - /* IPI vectors for APIC spurious and error interrupts */ - alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); - alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt); - - /* thermal monitor LVT interrupt */ -#ifdef CONFIG_X86_MCE_P4THERMAL - alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); -#endif -} - /** * connect_bsp_APIC - attach the APIC to the interrupt system */ Index: linux-2.6.git/arch/x86/kernel/irqinit_32.c =================================================================== --- linux-2.6.git.orig/arch/x86/kernel/irqinit_32.c 2008-08-11 18:16:22.000000000 +0400 +++ linux-2.6.git/arch/x86/kernel/irqinit_32.c 2008-08-11 18:23:51.000000000 +0400 @@ -74,6 +74,15 @@ void __init init_ISA_irqs (void) } } +/* + * IRQ2 is cascade interrupt to second interrupt controller + */ +static struct irqaction irq2 = { + .handler = no_action, + .mask = CPU_MASK_NONE, + .name = "cascade", +}; + /* Overridden in paravirt.c */ void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ"))); @@ -98,6 +107,46 @@ void __init native_init_IRQ(void) set_intr_gate(vector, interrupt[i]); } +#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_SMP) + /* + * IRQ0 must be given a fixed assignment and initialized, + * because it's used before the IO-APIC is set up. + */ + set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]); + + /* + * The reschedule interrupt is a CPU-to-CPU reschedule-helper + * IPI, driven by wakeup. + */ + alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt); + + /* IPI for invalidation */ + alloc_intr_gate(INVALIDATE_TLB_VECTOR, invalidate_interrupt); + + /* IPI for generic function call */ + alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt); + + /* IPI for single call function */ + set_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, call_function_single_interrupt); +#endif + +#ifdef CONFIG_X86_LOCAL_APIC + /* self generated IPI for local APIC timer */ + alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); + + /* IPI vectors for APIC spurious and error interrupts */ + alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); + alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt); +#endif + +#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_MCE_P4THERMAL) + /* thermal monitor LVT interrupt */ + alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); +#endif + + if (!acpi_ioapic) + setup_irq(2, &irq2); + /* setup after call gates are initialised (usually add in * the architecture specific gates) */ Index: linux-2.6.git/arch/x86/mach-default/setup.c =================================================================== --- linux-2.6.git.orig/arch/x86/mach-default/setup.c 2008-08-11 18:16:22.000000000 +0400 +++ linux-2.6.git/arch/x86/mach-default/setup.c 2008-08-11 18:22:51.000000000 +0400 @@ -38,15 +38,6 @@ void __init pre_intr_init_hook(void) init_ISA_irqs(); } -/* - * IRQ2 is cascade interrupt to second interrupt controller - */ -static struct irqaction irq2 = { - .handler = no_action, - .mask = CPU_MASK_NONE, - .name = "cascade", -}; - /** * intr_init_hook - post gate setup interrupt initialisation * @@ -62,12 +53,6 @@ void __init intr_init_hook(void) if (x86_quirks->arch_intr_init()) return; } -#ifdef CONFIG_X86_LOCAL_APIC - apic_intr_init(); -#endif - - if (!acpi_ioapic) - setup_irq(2, &irq2); } /** Index: linux-2.6.git/include/asm-x86/arch_hooks.h =================================================================== --- linux-2.6.git.orig/include/asm-x86/arch_hooks.h 2008-08-11 18:16:22.000000000 +0400 +++ linux-2.6.git/include/asm-x86/arch_hooks.h 2008-08-11 18:18:13.000000000 +0400 @@ -12,8 +12,6 @@ /* these aren't arch hooks, they are generic routines * that can be used by the hooks */ extern void init_ISA_irqs(void); -extern void apic_intr_init(void); -extern void smp_intr_init(void); extern irqreturn_t timer_interrupt(int irq, void *dev_id); /* these are the defined hooks */ ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-08-11 14:34 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-08-08 19:50 [PATCH -tip] x86: apic interrupts - move assignments to irqinit_32.c Cyrill Gorcunov 2008-08-11 12:57 ` Ingo Molnar 2008-08-11 13:06 ` Ingo Molnar 2008-08-11 14:34 ` Cyrill Gorcunov
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.