]> xenbits.xensource.com Git - xenclient/kernel.git/commitdiff
commit a6c4e076ee4c1ea670e4faa55814e63dd08e3f29 git-aae5f662a32c35b1a962627535acb588d48ff5f9
authort_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:05:21 +0000 (12:05 +0000)
committert_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:05:21 +0000 (12:05 +0000)
Author: Jeremy Fitzhardinge <jeremy@goop.org>
Date:   Wed May 2 19:27:12 2007 +0200

    [PATCH] i386: clean up identify_cpu

    identify_cpu() is used to identify both the boot CPU and secondary
    CPUs, but it performs some actions which only apply to the boot CPU.
    Those functions are therefore really __init functions, but because
    they're called by identify_cpu(), they must be marked __cpuinit.

    This patch splits identify_cpu() into identify_boot_cpu() and
    identify_secondary_cpu(), and calls the appropriate init functions
    from each.  Also, identify_boot_cpu() and all the functions it
    dominates are marked __init.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andi Kleen <ak@suse.de>
arch/i386/kernel/cpu/common.c
arch/i386/kernel/smpboot.c
include/asm-i386/processor.h

index 70c87de582c7a793ab346b60c4416bcdaa3a9f2c..564517988317cc4f42f8866366a6dd973e8ea5be 100644 (file)
@@ -351,7 +351,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;
 
@@ -461,15 +461,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
index efe07990e7fca6e6508b8e5ceb54caa55bad47c8..ea145ec380e5dd25c7c26db89762a52bd345d433 100644 (file)
@@ -158,7 +158,7 @@ static void __devinit smp_store_cpu_info(int id)
 
        *c = boot_cpu_data;
        if (id!=0)
-               identify_cpu(c);
+               identify_secondary_cpu(c);
        /*
         * Mask B, Pentium, but not Pentium MMX
         */
index b32346d62e1039d956c919b190836f2ab0217ef1..3beca2544c2469a69bc40ae524449d4afbdbd88e 100644 (file)
@@ -111,7 +111,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;