# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 0b8f92adc679c5c71f224e1beacb31b804abf24f
# Parent 99f4ba74763e00769d5383f0d349e900e52c1977
Fix CPU hotplug -- cpu initialisation functions must be declared
__cpuinit or later hotplug references freed code and data.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
diff -r 99f4ba74763e -r 0b8f92adc679
linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c Tue Nov 1
15:02:43 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c Tue Nov 1
15:28:20 2005
@@ -520,7 +520,7 @@
printk("\n");
}
-cpumask_t cpu_initialized __initdata = CPU_MASK_NONE;
+cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE;
/* This is hacky. :)
* We're emulating future behavior.
@@ -562,7 +562,7 @@
#endif
}
-void __init cpu_gdt_init(struct Xgt_desc_struct *gdt_descr)
+void __cpuinit cpu_gdt_init(struct Xgt_desc_struct *gdt_descr)
{
unsigned long frames[16];
unsigned long va;
@@ -585,7 +585,7 @@
* and IDT. We reload them nevertheless, this function acts as a
* 'CPU state barrier', nothing should get across.
*/
-void __init cpu_init (void)
+void __cpuinit cpu_init (void)
{
int cpu = smp_processor_id();
struct tss_struct * t = &per_cpu(init_tss, cpu);
diff -r 99f4ba74763e -r 0b8f92adc679
linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c Tue Nov 1
15:02:43 2005
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c Tue Nov 1
15:28:20 2005
@@ -35,7 +35,7 @@
#endif
char x86_boot_params[BOOT_PARAM_SIZE] __initdata = {0,};
-cpumask_t cpu_initialized __initdata = CPU_MASK_NONE;
+cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE;
struct x8664_pda cpu_pda[NR_CPUS] __cacheline_aligned;
@@ -130,7 +130,7 @@
xen_new_user_pt(__pa(init_level4_user_pgt));
}
-void __init cpu_gdt_init(struct desc_ptr *gdt_descr)
+void __cpuinit cpu_gdt_init(struct desc_ptr *gdt_descr)
{
unsigned long frames[16];
unsigned long va;
@@ -227,7 +227,7 @@
#endif
}
-void __init check_efer(void)
+void __cpuinit check_efer(void)
{
unsigned long efer;
@@ -244,7 +244,7 @@
* 'CPU state barrier', nothing should get across.
* A lot of state is already set up in PDA init.
*/
-void __init cpu_init (void)
+void __cpuinit cpu_init (void)
{
#ifdef CONFIG_SMP
int cpu = stack_smp_processor_id();
diff -r 99f4ba74763e -r 0b8f92adc679 patches/linux-2.6.12/cpu-hotplug-init.patch
--- /dev/null Tue Nov 1 15:02:43 2005
+++ b/patches/linux-2.6.12/cpu-hotplug-init.patch Tue Nov 1 15:28:20 2005
@@ -0,0 +1,34 @@
+diff -ur linux-2.6.12.orig/include/linux/init.h
linux-2.6.12/include/linux/init.h
+--- linux-2.6.12.orig/include/linux/init.h 2005-11-01 14:52:28.656025573
+0000
++++ linux-2.6.12/include/linux/init.h 2005-11-01 14:53:28.015791549 +0000
+@@ -229,6 +229,18 @@
+ #define __devexitdata __exitdata
+ #endif
+
++#ifdef CONFIG_HOTPLUG_CPU
++#define __cpuinit
++#define __cpuinitdata
++#define __cpuexit
++#define __cpuexitdata
++#else
++#define __cpuinit __init
++#define __cpuinitdata __initdata
++#define __cpuexit __exit
++#define __cpuexitdata __exitdata
++#endif
++
+ /* Functions marked as __devexit may be discarded at kernel link time,
depending
+ on config options. Newer versions of binutils detect references from
+ retained sections to discarded sections and flag an error. Pointers to
+diff -ur linux-2.6.12.orig/arch/x86_64/kernel/i387.c
linux-2.6.12/arch/x86_64/kernel/i387.c
+--- linux-2.6.12.orig/arch/x86_64/kernel/i387.c 2005-11-01
15:01:58.932991232 +0000
++++ linux-2.6.12/arch/x86_64/kernel/i387.c 2005-11-01 15:02:09.729312416
+0000
+@@ -42,7 +42,7 @@
+ * Called at bootup to set up the initial FPU state that is later cloned
+ * into all processes.
+ */
+-void __init fpu_init(void)
++void __cpuinit fpu_init(void)
+ {
+ unsigned long oldcr0 = read_cr0();
+ extern void __bad_fxsave_alignment(void);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|