diff options
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
| -rw-r--r-- | arch/x86/kernel/cpu/common.c | 20 | 
1 files changed, 12 insertions, 8 deletions
| diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index c3328d0e13f0..2ea16e05de43 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -655,6 +655,16 @@ void cpu_detect(struct cpuinfo_x86 *c)  	}  } +static void apply_forced_caps(struct cpuinfo_x86 *c) +{ +	int i; + +	for (i = 0; i < NCAPINTS; i++) { +		c->x86_capability[i] &= ~cpu_caps_cleared[i]; +		c->x86_capability[i] |= cpu_caps_set[i]; +	} +} +  void get_cpu_cap(struct cpuinfo_x86 *c)  {  	u32 eax, ebx, ecx, edx; @@ -1035,10 +1045,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)  		this_cpu->c_identify(c);  	/* Clear/Set all flags overridden by options, after probe */ -	for (i = 0; i < NCAPINTS; i++) { -		c->x86_capability[i] &= ~cpu_caps_cleared[i]; -		c->x86_capability[i] |= cpu_caps_set[i]; -	} +	apply_forced_caps(c);  #ifdef CONFIG_X86_64  	c->apicid = apic->phys_pkg_id(c->initial_apicid, 0); @@ -1097,10 +1104,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)  	 * Clear/Set all flags overridden by options, need do it  	 * before following smp all cpus cap AND.  	 */ -	for (i = 0; i < NCAPINTS; i++) { -		c->x86_capability[i] &= ~cpu_caps_cleared[i]; -		c->x86_capability[i] |= cpu_caps_set[i]; -	} +	apply_forced_caps(c);  	/*  	 * On SMP, boot_cpu_data holds the common feature set between | 
