Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/apic: Avoid the PVOPS indirection for the TSC deadline timer

XEN PV does not emulate the TSC deadline timer, so the PVOPS indirection
for writing the deadline MSR can be avoided completely.

Use native_wrmsrq() instead.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260224163429.877429827@kernel.org

authored by

Thomas Gleixner and committed by
Peter Zijlstra
23028286 92d0e753

+10 -3
+10 -3
arch/x86/kernel/apic/apic.c
··· 426 426 */ 427 427 u64 tsc = rdtsc(); 428 428 429 - wrmsrq(MSR_IA32_TSC_DEADLINE, tsc + (((u64) delta) * TSC_DIVISOR)); 429 + native_wrmsrq(MSR_IA32_TSC_DEADLINE, tsc + (((u64) delta) * TSC_DIVISOR)); 430 430 return 0; 431 431 } 432 432 ··· 450 450 * the timer _and_ zero the counter registers: 451 451 */ 452 452 if (v & APIC_LVT_TIMER_TSCDEADLINE) 453 - wrmsrq(MSR_IA32_TSC_DEADLINE, 0); 453 + native_wrmsrq(MSR_IA32_TSC_DEADLINE, 0); 454 454 else 455 455 apic_write(APIC_TMICT, 0); 456 456 ··· 547 547 548 548 if (!boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER)) 549 549 return false; 550 + 551 + /* XEN_PV does not support it, but be paranoia about it */ 552 + if (boot_cpu_has(X86_FEATURE_XENPV)) 553 + goto clear; 554 + 550 555 if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) 551 556 return true; 552 557 ··· 564 559 if (boot_cpu_data.microcode >= rev) 565 560 return true; 566 561 567 - setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER); 568 562 pr_err(FW_BUG "TSC_DEADLINE disabled due to Errata; " 569 563 "please update microcode to version: 0x%x (or later)\n", rev); 564 + 565 + clear: 566 + setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER); 570 567 return false; 571 568 } 572 569