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

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

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



Signed-off-by: default avatarYinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 56f0d033
Loading
Loading
Loading
Loading
+12 −3
Original line number Original line Diff line number Diff line
@@ -548,6 +548,10 @@ void __init early_cpu_init(void)
 * of early VIA chips and (more importantly) broken virtualizers that
 * of early VIA chips and (more importantly) broken virtualizers that
 * are not easy to detect.  Hence, probe for it based on first
 * are not easy to detect.  Hence, probe for it based on first
 * principles.
 * principles.
 *
 * Note: no 64-bit chip is known to lack these, but put the code here
 * for consistency with 32 bits, and to make it utterly trivial to
 * diagnose the problem should it ever surface.
 */
 */
static void __cpuinit detect_nopl(struct cpuinfo_x86 *c)
static void __cpuinit detect_nopl(struct cpuinfo_x86 *c)
{
{
@@ -586,11 +590,16 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)


	if (c->cpuid_level >= 0x00000001) {
	if (c->cpuid_level >= 0x00000001) {
		c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF;
		c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF;
#ifdef CONFIG_X86_32
# ifdef CONFIG_X86_HT
# ifdef CONFIG_X86_HT
		c->apicid = phys_pkg_id(c->initial_apicid, 0);
		c->apicid = phys_pkg_id(c->initial_apicid, 0);
		c->phys_proc_id = c->initial_apicid;
# else
# else
		c->apicid = c->initial_apicid;
		c->apicid = c->initial_apicid;
# endif
#endif

#ifdef CONFIG_X86_HT
		c->phys_proc_id = c->initial_apicid;
#endif
#endif
	}
	}


+16 −3
Original line number Original line Diff line number Diff line
@@ -581,6 +581,9 @@ static void __cpuinit detect_nopl(struct cpuinfo_x86 *c)


static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
{
{
	if (!have_cpuid_p())
		return;

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


	cpu_detect(c);
	cpu_detect(c);
@@ -589,10 +592,20 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)


	get_cpu_cap(c);
	get_cpu_cap(c);


	c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xff;
	if (c->cpuid_level >= 0x00000001) {
#ifdef CONFIG_SMP
		c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF;
#ifdef CONFIG_X86_32
# ifdef CONFIG_X86_HT
		c->apicid = phys_pkg_id(c->initial_apicid, 0);
# else
		c->apicid = c->initial_apicid;
# endif
#endif

#ifdef CONFIG_X86_HT
		c->phys_proc_id = c->initial_apicid;
		c->phys_proc_id = c->initial_apicid;
#endif
#endif
	}


	if (c->extended_cpuid_level >= 0x80000004)
	if (c->extended_cpuid_level >= 0x80000004)
		get_model_name(c); /* Default name */
		get_model_name(c); /* Default name */