Re: [PATCH] x86: fix section mismatch in LAPIC initialization

Previous thread: [PATCH] Fix i915 drm regression on AOpen i915GMm-HFS motherboard by Knut Petersen on Monday, January 3, 2011 - 7:25 am. (9 messages)

Next thread: [PATCH] name_to_dev_t() must not call __init code by Jan Beulich on Monday, January 3, 2011 - 8:07 am. (1 message)
From: Jan Beulich
Date: Monday, January 3, 2011 - 8:03 am

Doing things conditionally upon spm_processor_id() being zero is
generally a bad idea, as this means CPU 0 cannot be offlined and
brought back online later again. While there may be other places where
this is done, I think adding more of those should be avoided so that
some day SMP really becomes "symmetrical".

Signed-off-by: Jan Beulich <jbeulich@novell.com>

---
 arch/x86/include/asm/apic.h |    1 +
 arch/x86/kernel/apic/apic.c |    9 +++++++--
 arch/x86/kernel/smpboot.c   |    4 ++--
 3 files changed, 10 insertions(+), 4 deletions(-)

--- 2.6.37-rc8/arch/x86/include/asm/apic.h
+++ 2.6.37-rc8-x86-end-lapic-setup/arch/x86/include/asm/apic.h
@@ -233,6 +233,7 @@ extern void sync_Arb_IDs(void);
 extern void init_bsp_APIC(void);
 extern void setup_local_APIC(void);
 extern void end_local_APIC_setup(void);
+extern void bsp_end_local_APIC_setup(void);
 extern void init_apic_mappings(void);
 extern void setup_boot_APIC_clock(void);
 extern void setup_secondary_APIC_clock(void);
--- 2.6.37-rc8/arch/x86/kernel/apic/apic.c
+++ 2.6.37-rc8-x86-end-lapic-setup/arch/x86/kernel/apic/apic.c
@@ -1389,12 +1389,17 @@ void __cpuinit end_local_APIC_setup(void
 
 	setup_apic_nmi_watchdog(NULL);
 	apic_pm_activate();
+}
+
+void __init bsp_end_local_APIC_setup(void)
+{
+	end_local_APIC_setup();
 
 	/*
 	 * Now that local APIC setup is completed for BP, configure the fault
 	 * handling for interrupt remapping.
 	 */
-	if (!smp_processor_id() && intr_remapping_enabled)
+	if (intr_remapping_enabled)
 		enable_drhd_fault_handling();
 
 }
@@ -1751,7 +1756,7 @@ int __init APIC_init_uniprocessor(void)
 		enable_IO_APIC();
 #endif
 
-	end_local_APIC_setup();
+	bsp_end_local_APIC_setup();
 
 #ifdef CONFIG_X86_IO_APIC
 	if (smp_found_config && !skip_ioapic_setup && nr_ioapics)
--- 2.6.37-rc8/arch/x86/kernel/smpboot.c
+++ 2.6.37-rc8-x86-end-lapic-setup/arch/x86/kernel/smpboot.c
@@ -1065,7 +1065,7 @@ static int __init smp_sanity_check(unsig
 
 		connect_bsp_APIC();
 ...
From: H. Peter Anvin
Date: Monday, January 3, 2011 - 11:29 am

The description doesn't really match the subject line...

	-hpa
--

From: Jan Beulich
Date: Tuesday, January 4, 2011 - 1:42 am

The subject, imo, doesn't need further explanation. The description
was meant to explain why the function gets broken up rather than
just fiddling with other (called) functions' annotations. Are you
suggesting to drop the description altogether?

Jan

--

Previous thread: [PATCH] Fix i915 drm regression on AOpen i915GMm-HFS motherboard by Knut Petersen on Monday, January 3, 2011 - 7:25 am. (9 messages)

Next thread: [PATCH] name_to_dev_t() must not call __init code by Jan Beulich on Monday, January 3, 2011 - 8:07 am. (1 message)