Skip to contentSkip to conversation

x86/cpu/intel: Drop stray FAM6 check with new Intel CPU model defines

PATCH Applied Andrew Cooper 4 participants 5 messages May 29, 2024 – Jun 29, 2024 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/cpu/intel: Drop stray FAM6 check with new Intel CPU model defines

The outer if () should have been dropped when switching to c->x86_vfm.

Fixes 6568fc18c2f6 ("x86/cpu/intel: Switch to new Intel CPU model defines")

---
CC: Tony Luck <[email protected]>
CC: Dave Hansen <[email protected]>
CC: Thomas Gleixner <[email protected]>
CC: Ingo Molnar <[email protected]>
CC: Borislav Petkov <[email protected]>
CC: [email protected]
CC: "H. Peter Anvin" <[email protected]>
CC: Ashok Raj <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Alison Schofield <[email protected]>
CC: [email protected]

---
 arch/x86/kernel/cpu/intel.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
arch/x86/kernel/cpu/intel.c +7 -11
index a813089ca408..a9ea0dba6f0c 100644
@@ -294,17 +294,13 @@ static void early_init_intel(struct cpuinfo_x86 *c)
 	}
 
 	/* Penwell and Cloverview have the TSC which doesn't sleep on S3 */
-	if (c->x86 == 6) {
-		switch (c->x86_vfm) {
-		case INTEL_ATOM_SALTWELL_MID:
-		case INTEL_ATOM_SALTWELL_TABLET:
-		case INTEL_ATOM_SILVERMONT_MID:
-		case INTEL_ATOM_AIRMONT_NP:
-			set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC_S3);
-			break;
-		default:
-			break;
-		}
+	switch (c->x86_vfm) {
+	case INTEL_ATOM_SALTWELL_MID:
+	case INTEL_ATOM_SALTWELL_TABLET:
+	case INTEL_ATOM_SILVERMONT_MID:
+	case INTEL_ATOM_AIRMONT_NP:
+		set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC_S3);
+		break;
 	}
 
 	/*
Signature · 1 line
2.34.1
#1 lore raw
Quoted 1 line · Andrew Cooper

The outer if () should have been dropped when switching to c->x86_vfm.

FWIW, we are going to need to do a pass over all of arch/x86 looking for these. I suspect many of the 'if (c->x86 == ...) ' checks can go away like this one.

Thanks for finding this one, though!

Acked-by
#2 lore raw
Quoted 7 lines
Quoted 1 line

The outer if () should have been dropped when switching to c->x86_vfm.

FWIW, we are going to need to do a pass over all of arch/x86 looking for these. I suspect many of the 'if (c->x86 == ...) ' checks can go away like this one.

Thanks for finding this one, though!

Yup.

#3 lore raw
Quoted 9 lines · Tony
Quoted 6 lines
Quoted 1 line

The outer if () should have been dropped when switching to c->x86_vfm.

FWIW, we are going to need to do a pass over all of arch/x86 looking for these. I suspect many of the 'if (c->x86 == ...) ' checks can go away like this one.

Thanks for finding this one, though!

Yup.

Thanks.  FWIW, none of the other uses of c->x86 I looked at seem trivial to convert.

This one I only happened to notice because it stood out in context.

~Andrew

merge bot Applied
#4 lore raw
In reply to Andrew Cooper
The following commit has been merged into the x86/cpu branch of tip:

The following commit has been merged into the x86/cpu branch of tip:

Commit-ID:     34b3fc558b537bdf99644dcde539e151716f6331
Gitweb:        https://git.kernel.org/tip/34b3fc558b537bdf99644dcde539e151716f6331
Author:        Andrew Cooper <[email protected]>
AuthorDate:    Wed, 29 May 2024 19:36:05 +01:00
Committer:     Borislav Petkov (AMD) <[email protected]>
CommitterDate: Sat, 29 Jun 2024 16:10:37 +02:00

x86/cpu/intel: Drop stray FAM6 check with new Intel CPU model defines

The outer if () should have been dropped when switching to c->x86_vfm.

Fixes 6568fc18c2f6 ("x86/cpu/intel: Switch to new Intel CPU model defines")
---
 arch/x86/kernel/cpu/intel.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
arch/x86/kernel/cpu/intel.c +7 -11
index a813089..a9ea0db 100644
@@ -294,17 +294,13 @@ static void early_init_intel(struct cpuinfo_x86 *c)
 	}
 
 	/* Penwell and Cloverview have the TSC which doesn't sleep on S3 */
-	if (c->x86 == 6) {
-		switch (c->x86_vfm) {
-		case INTEL_ATOM_SALTWELL_MID:
-		case INTEL_ATOM_SALTWELL_TABLET:
-		case INTEL_ATOM_SILVERMONT_MID:
-		case INTEL_ATOM_AIRMONT_NP:
-			set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC_S3);
-			break;
-		default:
-			break;
-		}
+	switch (c->x86_vfm) {
+	case INTEL_ATOM_SALTWELL_MID:
+	case INTEL_ATOM_SALTWELL_TABLET:
+	case INTEL_ATOM_SILVERMONT_MID:
+	case INTEL_ATOM_AIRMONT_NP:
+		set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC_S3);
+		break;
 	}
 
 	/*