Skip to contentSkip to conversation

x86/cpu: Move identify_cpu_without_cpuid() into main branch

PATCH In review Nikolay Borisov 2 participants 4 messages May 21, 2024 – Jun 10, 2024 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/cpu: Move identify_cpu_without_cpuid() into main branch

No point in duplicating if (!have_cpuid_p()) check. Simply move identify_cpu_without_cpuid() into the else branch. No functional changes.

---
 arch/x86/kernel/cpu/common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/cpu/common.c +1 -3
index 2b170da84f97..69265c0acaea 100644
@@ -1578,9 +1578,6 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 	memset(&c->x86_capability, 0, sizeof(c->x86_capability));
 	c->extended_cpuid_level = 0;
 
-	if (!have_cpuid_p())
-		identify_cpu_without_cpuid(c);
-
 	/* cyrix could have cpuid enabled via c_identify()*/
 	if (have_cpuid_p()) {
 		cpu_detect(c);
@@ -1601,6 +1598,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 		if (this_cpu->c_bsp_init)
 			this_cpu->c_bsp_init(c);
 	} else {
+		identify_cpu_without_cpuid(c);
 		setup_clear_cpu_cap(X86_FEATURE_CPUID);
 		get_cpu_address_sizes(c);
 		cpu_init_topology(c);
Signature · 1 line
2.34.1
#1 lore raw
Quoted 5 lines · Nikolay Borisov

No point in duplicating if (!have_cpuid_p()) check. Simply move identify_cpu_without_cpuid() into the else branch. No functional changes.

ping

Quoted 26 lines
---
  arch/x86/kernel/cpu/common.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/cpu/common.c +1 -3
index 2b170da84f97..69265c0acaea 100644
@@ -1578,9 +1578,6 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
  	memset(&c->x86_capability, 0, sizeof(c->x86_capability));
  	c->extended_cpuid_level = 0;
 
-	if (!have_cpuid_p())
-		identify_cpu_without_cpuid(c);
-
  	/* cyrix could have cpuid enabled via c_identify()*/
  	if (have_cpuid_p()) {
  		cpu_detect(c);
@@ -1601,6 +1598,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
  		if (this_cpu->c_bsp_init)
  			this_cpu->c_bsp_init(c);
  	} else {
+		identify_cpu_without_cpuid(c);
  		setup_clear_cpu_cap(X86_FEATURE_CPUID);
  		get_cpu_address_sizes(c);
  		cpu_init_topology(c);
#2 lore raw
In reply to Nikolay Borisov
Quoted 3 lines · Nikolay Borisov

No point in duplicating if (!have_cpuid_p()) check. Simply move identify_cpu_without_cpuid() into the else branch. No functional changes.

You wish :)

Quoted 10 lines
---
 arch/x86/kernel/cpu/common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/cpu/common.c +0 -0
index 2b170da84f97..69265c0acaea 100644

arch/x86/kernel/cpu/common.c static void __init early_identify_cpu(struct cpuinfo_x86 *c) · line 1583

Quoted 6 lines
arch/x86/kernel/cpu/common.c +0 -3
@@ -1578,9 +1578,6 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 	memset(&c->x86_capability, 0, sizeof(c->x86_capability));
 	c->extended_cpuid_level = 0;
 
-	if (!have_cpuid_p())
-		identify_cpu_without_cpuid(c);
-

You might look what identify_cpu_without_cpuid() does and how the comment right here might be related:

arch/x86/kernel/cpu/common.c static void __init early_identify_cpu(struct cpuinfo_x86 *c) · line 1582

Quoted 2 lines
arch/x86/kernel/cpu/common.c +0 -0
 	/* cyrix could have cpuid enabled via c_identify()*/
 	if (have_cpuid_p()) {

Thanks,

tglx

#3 lore raw
Quoted 20 lines · Thomas Gleixner
Quoted 3 lines · Nikolay Borisov

No point in duplicating if (!have_cpuid_p()) check. Simply move identify_cpu_without_cpuid() into the else branch. No functional changes.

You wish :)

Quoted 13 lines
---
  arch/x86/kernel/cpu/common.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/cpu/common.c +0 -0
index 2b170da84f97..69265c0acaea 100644
@@ -1578,9 +1578,6 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
  	memset(&c->x86_capability, 0, sizeof(c->x86_capability));
  	c->extended_cpuid_level = 0;
 
Quoted 6 lines

arch/x86/kernel/cpu/common.c static void __init early_identify_cpu(struct cpuinfo_x86 *c) · line 1583

Quoted 3 lines
arch/x86/kernel/cpu/common.c +0 -3
-	if (!have_cpuid_p())
-		identify_cpu_without_cpuid(c);
-

You might look what identify_cpu_without_cpuid() does and how the comment right here might be related:

Doh, fair enough. OTOH is Cyrix still relevant? Google says Defunct: November 11, 1997; 26 years ago

Quoted 7 lines

arch/x86/kernel/cpu/common.c static void __init early_identify_cpu(struct cpuinfo_x86 *c) · line 1582

Quoted 3 lines
arch/x86/kernel/cpu/common.c +0 -0
  	/* cyrix could have cpuid enabled via c_identify()*/
  	if (have_cpuid_p()) {

Thanks,

tglx