diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-03-19 13:25:28 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:41:01 -0400 |
commit | 693d4b8a6429af7f2029df20a59e22f4d752e141 (patch) | |
tree | 512a24d553a31eedb5aa69a1382c861c13491ac5 /arch/x86/kernel | |
parent | 904541e2f76bc3efe4cc9978b7adb3323ea8607e (diff) |
x86: do smp tainting checks in a separate function
It will ease integration for x86_64
Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/smpboot.c | 21 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot_32.c | 20 |
2 files changed, 21 insertions, 20 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 02427d1003d3..ddb94ef37789 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -45,10 +45,8 @@ unsigned char *trampoline_base = __va(SMP_TRAMPOLINE_BASE); | |||
45 | /* representing cpus for which sibling maps can be computed */ | 45 | /* representing cpus for which sibling maps can be computed */ |
46 | static cpumask_t cpu_sibling_setup_map; | 46 | static cpumask_t cpu_sibling_setup_map; |
47 | 47 | ||
48 | #ifdef CONFIG_X86_32 | ||
49 | /* Set if we find a B stepping CPU */ | 48 | /* Set if we find a B stepping CPU */ |
50 | int __cpuinitdata smp_b_stepping; | 49 | int __cpuinitdata smp_b_stepping; |
51 | #endif | ||
52 | 50 | ||
53 | static void __cpuinit smp_apply_quirks(struct cpuinfo_x86 *c) | 51 | static void __cpuinit smp_apply_quirks(struct cpuinfo_x86 *c) |
54 | { | 52 | { |
@@ -105,6 +103,25 @@ valid_k7: | |||
105 | #endif | 103 | #endif |
106 | } | 104 | } |
107 | 105 | ||
106 | void smp_checks(void) | ||
107 | { | ||
108 | if (smp_b_stepping) | ||
109 | printk(KERN_WARNING "WARNING: SMP operation may be unreliable" | ||
110 | "with B stepping processors.\n"); | ||
111 | |||
112 | /* | ||
113 | * Don't taint if we are running SMP kernel on a single non-MP | ||
114 | * approved Athlon | ||
115 | */ | ||
116 | if (tainted & TAINT_UNSAFE_SMP) { | ||
117 | if (cpus_weight(cpu_present_map)) | ||
118 | printk(KERN_INFO "WARNING: This combination of AMD" | ||
119 | "processors is not suitable for SMP.\n"); | ||
120 | else | ||
121 | tainted &= ~TAINT_UNSAFE_SMP; | ||
122 | } | ||
123 | } | ||
124 | |||
108 | /* | 125 | /* |
109 | * The bootstrap kernel entry code has set these up. Save them for | 126 | * The bootstrap kernel entry code has set these up. Save them for |
110 | * a given CPU | 127 | * a given CPU |
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c index 34493f8ba8ac..361851cdaa97 100644 --- a/arch/x86/kernel/smpboot_32.c +++ b/arch/x86/kernel/smpboot_32.c | |||
@@ -59,8 +59,6 @@ | |||
59 | #include <asm/vmi.h> | 59 | #include <asm/vmi.h> |
60 | #include <asm/mtrr.h> | 60 | #include <asm/mtrr.h> |
61 | 61 | ||
62 | extern int smp_b_stepping; | ||
63 | |||
64 | static cpumask_t smp_commenced_mask; | 62 | static cpumask_t smp_commenced_mask; |
65 | 63 | ||
66 | /* which logical CPU number maps to which CPU (physical APIC ID) */ | 64 | /* which logical CPU number maps to which CPU (physical APIC ID) */ |
@@ -791,6 +789,7 @@ static int __init smp_sanity_check(unsigned max_cpus) | |||
791 | } | 789 | } |
792 | 790 | ||
793 | extern void impress_friends(void); | 791 | extern void impress_friends(void); |
792 | extern void smp_checks(void); | ||
794 | /* | 793 | /* |
795 | * Cycle through the processors sending APIC IPIs to boot each. | 794 | * Cycle through the processors sending APIC IPIs to boot each. |
796 | */ | 795 | */ |
@@ -865,22 +864,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) | |||
865 | 864 | ||
866 | impress_friends(); | 865 | impress_friends(); |
867 | 866 | ||
868 | if (smp_b_stepping) | 867 | smp_checks(); |
869 | printk(KERN_WARNING "WARNING: SMP operation may be unreliable with B stepping processors.\n"); | ||
870 | |||
871 | /* | ||
872 | * Don't taint if we are running SMP kernel on a single non-MP | ||
873 | * approved Athlon | ||
874 | */ | ||
875 | if (tainted & TAINT_UNSAFE_SMP) { | ||
876 | if (cpus_weight(cpu_present_map)) | ||
877 | printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n"); | ||
878 | else | ||
879 | tainted &= ~TAINT_UNSAFE_SMP; | ||
880 | } | ||
881 | |||
882 | Dprintk("Boot done.\n"); | ||
883 | |||
884 | /* | 868 | /* |
885 | * construct cpu_sibling_map, so that we can tell sibling CPUs | 869 | * construct cpu_sibling_map, so that we can tell sibling CPUs |
886 | * efficiently. | 870 | * efficiently. |