Skip to contentSkip to conversation

x86/apic: Drop useless CXL/CPX row from the TSC deadline errata table

PATCH New Andrew Cooper 3 participants 6 messages Jul 16, 2025 – Jan 6 x86

lore
Share & tools
lore
#0 lore raw

A microcode revision of 0 is guaranteed to exit apic_validate_deadline_timer() early, but a better way is with no row at all.

No functional change.

---
CC: Thomas Gleixner <[email protected]>
CC: Ingo Molnar <[email protected]>
CC: Borislav Petkov <[email protected]>
CC: Dave Hansen <[email protected]>
CC: [email protected]
CC: "H. Peter Anvin" <[email protected]>
CC: Peter Zijlstra <[email protected]>
CC: Sohil Mehta <[email protected]>
CC: Yuntao Wang <[email protected]>
CC: Zhang Rui <[email protected]>
CC: [email protected]

Strictly speaking, this is:

Fixes 66abf2388331 ("x86/apic: Convert the TSC deadline timer matching to steppings macro")

but I really don't think it's interesting to backport.

arch/x86/kernel/apic/apic.c +0 -1
index d73ba5a7b623..6ace71c52bee 100644
@@ -522,7 +522,6 @@ static const struct x86_cpu_id deadline_match[] __initconst = {
 
 	X86_MATCH_VFM_STEPS(INTEL_SKYLAKE_X,   0x3, 0x3, 0x01000136),
 	X86_MATCH_VFM_STEPS(INTEL_SKYLAKE_X,   0x4, 0x4, 0x02000014),
-	X86_MATCH_VFM_STEPS(INTEL_SKYLAKE_X,   0x5, 0xf, 0),
 
 	X86_MATCH_VFM(INTEL_HASWELL,		0x22),
 	X86_MATCH_VFM(INTEL_HASWELL_L,		0x20),
Reviewed-by
#1 lore raw
Quoted 3 lines · Andrew Cooper

A microcode revision of 0 is guaranteed to exit apic_validate_deadline_timer() early, but a better way is with no row at all.

Yeah, not having an entry is much better. "exit" can be a bit ambiguous. Should we be slightly more precise?

A microcode revision of 0 is guaranteed to return true for apic_validate_deadline_timer(), but a better way is with no row at all.

Quoted 4 lines

No functional change.

---

Quoted 18 lines
CC Thomas Gleixner <[email protected]>
CC Ingo Molnar <[email protected]>
CC Borislav Petkov <[email protected]>
CC Dave Hansen <[email protected]>
CC "H. Peter Anvin" <[email protected]>
CC Peter Zijlstra <[email protected]>
CC Sohil Mehta <[email protected]>
CC Yuntao Wang <[email protected]>
CC Zhang Rui <[email protected]>

Strictly speaking, this is:

Fixes 66abf2388331 ("x86/apic: Convert the TSC deadline timer matching to steppings macro")

but I really don't think it's interesting to backport.

#2 lore raw
Quoted 6 lines · Sohil Mehta
Quoted 3 lines · Andrew Cooper

A microcode revision of 0 is guaranteed to exit apic_validate_deadline_timer() early, but a better way is with no row at all.

Yeah, not having an entry is much better. "exit" can be a bit ambiguous. Should we be slightly more precise?

It's "exit $foo early", although this is slightly hidden by the linebreak.

Alternatively, it could be phrased as "exit early from $foo" if you think that's clearer?

Quoted 9 lines

A microcode revision of 0 is guaranteed to return true for apic_validate_deadline_timer(), but a better way is with no row at all.

Quoted 4 lines

No functional change.

---

Thanks.

~Andrew

#3 lore raw
Quoted 10 lines · Andrew Cooper
Quoted 6 lines · Sohil Mehta
Quoted 3 lines · Andrew Cooper

A microcode revision of 0 is guaranteed to exit apic_validate_deadline_timer() early, but a better way is with no row at all.

Yeah, not having an entry is much better. "exit" can be a bit ambiguous. Should we be slightly more precise?

It's "exit $foo early", although this is slightly hidden by the linebreak.

Sorry, I was being too finicky.

I meant that a microcode revision of 0 would cause apic_validate_deadline_timer() to exit with the return value of true.

	if (boot_cpu_data.microcode >= rev)
		return true;

Not having a row as well would return true because of:

	m = x86_match_cpu(deadline_match);
	if (!m)
		return true;

I wanted to highlight that apic_validate_deadline_timer() would return *true* in both cases, rather than just "exit" early.

What you have right now is okay as well :)

Quoted 7 lines

Alternatively, it could be phrased as "exit early from $foo" if you think that's clearer?

Quoted 4 lines

A microcode revision of 0 is guaranteed to return true for apic_validate_deadline_timer(), but a better way is with no row at all.

Sohil

#4 lore raw

Re: x86/apic: Drop useless row from the TSC deadline errata table

In reply to Andrew Cooper
Quoted 5 lines · Andrew Cooper

A microcode revision of 0 is guaranteed to exit apic_validate_deadline_timer() early, but a better way is with no row at all.

No functional change.

There's one bit of background that is missing which is that the steppings are unaffected by the erratum. How about this for a changelog?

The later INTEL_SKYLAKE_X steppings (0x5=>0xf, aka. CXL/CPX) are unaffected by the TSC deadline erratum. There is an entry in the deadline_match[] table to reflect this. It puts puts a '0' in the table to represent that all microcode versions >=0 are unaffected by the erratum.

That entry is unnecessary. The best way to indicate that a CPU is unaffected is to simply omit it from the table.

Remove the stepping >=0x5 entry from the table.

#5 lore raw

PATCH v2 1/1 x86/apic: Drop useless CXL/CPX row from the TSC deadline errata table

In reply to Andrew Cooper

This erratum is fixed in later steppings.

Instead of including the fixed steppings in the table in a way that will unconditionally cause apic_validate_deadline_timer() to decide "not vulnerable", simply omit the row.

No functional change.

---
CC: Thomas Gleixner <[email protected]>
CC: Ingo Molnar <[email protected]>
CC: Borislav Petkov <[email protected]>
CC: Dave Hansen <[email protected]>
CC: [email protected]
CC: "H. Peter Anvin" <[email protected]>
CC: Peter Zijlstra <[email protected]>
CC: Sohil Mehta <[email protected]>
CC: Yuntao Wang <[email protected]>
CC: Zhang Rui <[email protected]>
CC: [email protected]

v2:
* Adjust the commit message.

Strictly speaking, this is:

Fixes 66abf2388331 ("x86/apic: Convert the TSC deadline timer matching to steppings macro")

but I really don't think it's interesting to backport.

---
 arch/x86/kernel/apic/apic.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/kernel/apic/apic.c +0 -1
index d93f87f29d03..829c8efce1c1 100644
@@ -524,7 +524,6 @@ static const struct x86_cpu_id deadline_match[] __initconst = {
 
 	X86_MATCH_VFM_STEPS(INTEL_SKYLAKE_X,   0x3, 0x3, 0x01000136),
 	X86_MATCH_VFM_STEPS(INTEL_SKYLAKE_X,   0x4, 0x4, 0x02000014),
-	X86_MATCH_VFM_STEPS(INTEL_SKYLAKE_X,   0x5, 0xf, 0),
 
 	X86_MATCH_VFM(INTEL_HASWELL,		0x22),
 	X86_MATCH_VFM(INTEL_HASWELL_L,		0x20),

base-commit: 7f98ab9da046865d57c102fd3ca9669a29845f67

Signature · 1 line
2.39.5