From: t_jeang Date: Tue, 6 Jan 2009 12:05:21 +0000 (+0000) Subject: imported patch git-a6c4e076ee4c1ea670e4faa55814e63dd08e3f29-xen X-Git-Tag: git-a6c4e076ee4c1ea670e4faa55814e63dd08e3f29 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1bac367b4a9d76c246657c0e303104467c792cb1;p=xenclient%2Fkernel.git imported patch git-a6c4e076ee4c1ea670e4faa55814e63dd08e3f29-xen --- diff --git a/arch/i386/kernel/cpu/common-xen.c b/arch/i386/kernel/cpu/common-xen.c index e509783d..a907aab8 100644 --- a/arch/i386/kernel/cpu/common-xen.c +++ b/arch/i386/kernel/cpu/common-xen.c @@ -358,7 +358,7 @@ __setup("serialnumber", x86_serial_nr_setup); /* * This does the hard work of actually picking apart the CPU stuff... */ -void __cpuinit identify_cpu(struct cpuinfo_x86 *c) +static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) { int i; @@ -468,15 +468,22 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c) /* Init Machine Check Exception if available. */ mcheck_init(c); +} - if (c == &boot_cpu_data) - sysenter_setup(); +void __init identify_boot_cpu(void) +{ + identify_cpu(&boot_cpu_data); + sysenter_setup(); enable_sep_cpu(); + mtrr_bp_init(); +} - if (c == &boot_cpu_data) - mtrr_bp_init(); - else - mtrr_ap_init(); +void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c) +{ + BUG_ON(c == &boot_cpu_data); + identify_cpu(c); + enable_sep_cpu(); + mtrr_ap_init(); } #ifdef CONFIG_X86_HT diff --git a/drivers/xen/core/smpboot.c b/drivers/xen/core/smpboot.c index deb5f991..5b31d1f4 100644 --- a/drivers/xen/core/smpboot.c +++ b/drivers/xen/core/smpboot.c @@ -167,8 +167,16 @@ static void xen_smp_intr_exit(unsigned int cpu) void __cpuinit cpu_bringup(void) { + struct cpuinfo_x86 *c = cpu_data + smp_processor_id(); + cpu_init(); - identify_cpu(cpu_data + smp_processor_id()); + if (c != &boot_cpu_data) { +#ifdef CONFIG_X86_32 + identify_secondary_cpu(c); +#else + identify_cpu(c); +#endif + } touch_softlockup_watchdog(); preempt_disable(); local_irq_enable(); diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h index 2a9e4ee5..cce4c930 100644 --- a/include/asm-i386/bugs.h +++ b/include/asm-i386/bugs.h @@ -180,7 +180,7 @@ extern void alternative_instructions(void); static void __init check_bugs(void) { - identify_cpu(&boot_cpu_data); + identify_boot_cpu(); #ifndef CONFIG_SMP printk("CPU: "); print_cpu_info(&boot_cpu_data); diff --git a/include/asm-i386/mach-xen/asm/processor.h b/include/asm-i386/mach-xen/asm/processor.h index ad8b9d47..c7a0fbf9 100644 --- a/include/asm-i386/mach-xen/asm/processor.h +++ b/include/asm-i386/mach-xen/asm/processor.h @@ -114,7 +114,8 @@ extern struct cpuinfo_x86 cpu_data[]; extern int cpu_llc_id[NR_CPUS]; extern char ignore_fpu_irq; -extern void identify_cpu(struct cpuinfo_x86 *); +extern void identify_boot_cpu(void); +extern void identify_secondary_cpu(struct cpuinfo_x86 *); extern void print_cpu_info(struct cpuinfo_x86 *); extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); extern unsigned short num_cache_leaves;