Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6627d242 authored by Yinghai Lu's avatar Yinghai Lu Committed by Ingo Molnar
Browse files

x86: cpu/common*.c, merge early_identify_cpu()



Signed-off-by: default avatarYinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 5122c890
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -490,7 +490,11 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
 */
 */
static void __init early_identify_cpu(struct cpuinfo_x86 *c)
static void __init early_identify_cpu(struct cpuinfo_x86 *c)
{
{
#ifdef CONFIG_X86_64
	c->x86_clflush_size = 64;
#else
	c->x86_clflush_size = 32;
	c->x86_clflush_size = 32;
#endif
	c->x86_cache_alignment = c->x86_clflush_size;
	c->x86_cache_alignment = c->x86_clflush_size;


	if (!have_cpuid_p())
	if (!have_cpuid_p())
+16 −3
Original line number Original line Diff line number Diff line
@@ -482,15 +482,28 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
#endif
#endif
}
}


/* Do some early cpuid on the boot CPU to get some parameter that are
/*
   needed before check_bugs. Everything advanced is in identify_cpu
 * Do minimum CPU detection early.
   below. */
 * Fields really needed: vendor, cpuid_level, family, model, mask,
 * cache alignment.
 * The others are not touched to avoid unwanted side effects.
 *
 * WARNING: this function is only called on the BP.  Don't add code here
 * that is supposed to run on all CPUs.
 */
static void __init early_identify_cpu(struct cpuinfo_x86 *c)
static void __init early_identify_cpu(struct cpuinfo_x86 *c)
{
{


#ifdef CONFIG_X86_64
	c->x86_clflush_size = 64;
	c->x86_clflush_size = 64;
#else
	c->x86_clflush_size = 32;
#endif
	c->x86_cache_alignment = c->x86_clflush_size;
	c->x86_cache_alignment = c->x86_clflush_size;


	if (!have_cpuid_p())
		return;

	memset(&c->x86_capability, 0, sizeof c->x86_capability);
	memset(&c->x86_capability, 0, sizeof c->x86_capability);


	c->extended_cpuid_level = 0;
	c->extended_cpuid_level = 0;