diff options
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 77848d9fca68..b0517aa2bd3b 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -299,7 +299,8 @@ static const char *__cpuinit table_lookup_model(struct cpuinfo_x86 *c) | |||
299 | return NULL; /* Not found */ | 299 | return NULL; /* Not found */ |
300 | } | 300 | } |
301 | 301 | ||
302 | __u32 cleared_cpu_caps[NCAPINTS] __cpuinitdata; | 302 | __u32 cpu_caps_cleared[NCAPINTS] __cpuinitdata; |
303 | __u32 cpu_caps_set[NCAPINTS] __cpuinitdata; | ||
303 | 304 | ||
304 | void load_percpu_segment(int cpu) | 305 | void load_percpu_segment(int cpu) |
305 | { | 306 | { |
@@ -768,6 +769,12 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) | |||
768 | if (this_cpu->c_identify) | 769 | if (this_cpu->c_identify) |
769 | this_cpu->c_identify(c); | 770 | this_cpu->c_identify(c); |
770 | 771 | ||
772 | /* Clear/Set all flags overriden by options, after probe */ | ||
773 | for (i = 0; i < NCAPINTS; i++) { | ||
774 | c->x86_capability[i] &= ~cpu_caps_cleared[i]; | ||
775 | c->x86_capability[i] |= cpu_caps_set[i]; | ||
776 | } | ||
777 | |||
771 | #ifdef CONFIG_X86_64 | 778 | #ifdef CONFIG_X86_64 |
772 | c->apicid = apic->phys_pkg_id(c->initial_apicid, 0); | 779 | c->apicid = apic->phys_pkg_id(c->initial_apicid, 0); |
773 | #endif | 780 | #endif |
@@ -813,6 +820,16 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) | |||
813 | #endif | 820 | #endif |
814 | 821 | ||
815 | init_hypervisor(c); | 822 | init_hypervisor(c); |
823 | |||
824 | /* | ||
825 | * Clear/Set all flags overriden by options, need do it | ||
826 | * before following smp all cpus cap AND. | ||
827 | */ | ||
828 | for (i = 0; i < NCAPINTS; i++) { | ||
829 | c->x86_capability[i] &= ~cpu_caps_cleared[i]; | ||
830 | c->x86_capability[i] |= cpu_caps_set[i]; | ||
831 | } | ||
832 | |||
816 | /* | 833 | /* |
817 | * On SMP, boot_cpu_data holds the common feature set between | 834 | * On SMP, boot_cpu_data holds the common feature set between |
818 | * all CPUs; so make sure that we indicate which features are | 835 | * all CPUs; so make sure that we indicate which features are |
@@ -825,10 +842,6 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) | |||
825 | boot_cpu_data.x86_capability[i] &= c->x86_capability[i]; | 842 | boot_cpu_data.x86_capability[i] &= c->x86_capability[i]; |
826 | } | 843 | } |
827 | 844 | ||
828 | /* Clear all flags overriden by options */ | ||
829 | for (i = 0; i < NCAPINTS; i++) | ||
830 | c->x86_capability[i] &= ~cleared_cpu_caps[i]; | ||
831 | |||
832 | #ifdef CONFIG_X86_MCE | 845 | #ifdef CONFIG_X86_MCE |
833 | /* Init Machine Check Exception if available. */ | 846 | /* Init Machine Check Exception if available. */ |
834 | mcheck_init(c); | 847 | mcheck_init(c); |