linux/arch/x86/kernel
Daniel J Blueman bdd621ccc9 x86/tsc: Trust initial offset in architectural TSC-adjust MSRs
commit 455f9075f1 upstream.

When the BIOS configures the architectural TSC-adjust MSRs on secondary
sockets to correct a constant inter-chassis offset, after Linux brings the
cores online, the TSC sync check later resets the core-local MSR to 0,
triggering HPET fallback and leading to performance loss.

Fix this by unconditionally using the initial adjust values read from the
MSRs. Trusting the initial offsets in this architectural mechanism is a
better approach than special-casing workarounds for specific platforms.

Signed-off-by: Daniel J Blueman <daniel@quora.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Steffen Persvold <sp@numascale.com>
Reviewed-by: James Cleverdon <james.cleverdon.external@eviden.com>
Reviewed-by: Dimitri Sivanich <sivanich@hpe.com>
Reviewed-by: Prarit Bhargava <prarit@redhat.com>
Link: https://lore.kernel.org/r/20240419085146.175665-1-daniel@quora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-16 13:39:11 +02:00
..
acpi x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility 2023-11-08 17:26:43 +01:00
apic x86/apic: Fix kernel panic when booting with intremap=off and x2apic_phys 2023-06-28 10:29:53 +02:00
cpu x86/cpufeatures: Fix dependencies for GFNI, VAES, and VPCLMULQDQ 2024-04-27 17:05:26 +02:00
fpu x86/fpu: Stop relying on userspace for info to fault in xsave buffer 2024-03-01 13:21:43 +01:00
kprobes x86/alternatives: Introduce int3_emulate_jcc() 2024-04-10 16:18:49 +02:00
.gitignore
alternative.c x86/alternatives: Teach text_poke_bp() to patch Jcc.d32 instructions 2024-04-10 16:18:49 +02:00
amd_gart_64.c x86/amd_gart: don't set failed sg dma_address to DMA_MAPPING_ERROR 2021-08-09 17:13:06 +02:00
amd_nb.c hwmon: (k10temp) Add support for yellow carp 2021-08-27 13:54:58 -07:00
aperture_64.c memblock: make memblock_find_in_range method private 2021-09-03 09:58:17 -07:00
apm_32.c x86/APM: drop the duplicate APM_MINOR_DEV macro 2023-09-19 12:22:45 +02:00
asm-offsets_32.c x86/stackprotector/32: Make the canary into a regular percpu variable 2021-03-08 13:19:05 +01:00
asm-offsets_64.c x86/xen: Drop USERGS_SYSRET64 paravirt call 2021-02-10 12:32:07 +01:00
asm-offsets.c x86/paravirt: Switch iret pvops to ALTERNATIVE 2021-03-11 19:58:54 +01:00
audit_64.c
bootflag.c
cc_platform.c x86/sev: Add an x86 version of cc_platform_has() 2021-11-18 19:17:21 +01:00
check.c
cpuid.c
crash_core_32.c
crash_core_64.c
crash_dump_32.c
crash_dump_64.c
crash.c x86/crash: Disable virt in core NMI crash handler to avoid double shootdown 2023-03-10 09:40:01 +01:00
devicetree.c
doublefault_32.c x86/stackprotector/32: Make the canary into a regular percpu variable 2021-03-08 13:19:05 +01:00
dumpstack_32.c
dumpstack_64.c x86/mm/64: Improve stack overflow warnings 2021-11-18 19:16:10 +01:00
dumpstack.c x86/show_trace_log_lvl: Ensure stack pointer is aligned, again 2023-05-30 13:55:32 +01:00
e820.c x86/boot: Fix memremap of setup_indirect structures 2022-03-16 14:23:45 +01:00
early_printk.c
early-quirks.c x86/gpu: Reserve stolen memory for first integrated Intel GPU 2022-01-27 11:02:51 +01:00
ebda.c
eisa.c
espfix_64.c
ftrace_32.S x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
ftrace_64.S x86/ibt,ftrace: Make function-graph play nice 2022-08-21 15:17:48 +02:00
ftrace.c x86/returnthunk: Allow different return thunks 2024-03-01 13:21:49 +01:00
head32.c
head64.c x86/boot: Fix incorrect startup_gdt_descr.size 2023-11-20 11:08:13 +01:00
head_32.S x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit 2022-07-23 12:54:12 +02:00
head_64.S objtool: Add entry UNRET validation 2022-07-23 12:54:06 +02:00
hpet.c rtc: Check return value from mc146818_get_time() 2022-04-13 20:59:14 +02:00
hw_breakpoint.c
i8237.c
i8253.c
i8259.c x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility 2023-11-08 17:26:43 +01:00
idt.c X86 interrupt related changes: 2021-06-29 12:36:59 -07:00
io_delay.c
ioport.c
irq_32.c softirq: Move do_softirq_own_stack() to generic asm header 2021-02-10 23:34:16 +01:00
irq_64.c x86/softirq/64: Inline do_softirq_own_stack() 2021-02-10 23:34:17 +01:00
irq_work.c
irq.c x86/irq: Ensure PI wakeup handler is unregistered before module unload 2021-11-18 19:15:56 +01:00
irqflags.S x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
irqinit.c x86/i8259: Mark legacy PIC interrupts with IRQ_LEVEL 2023-02-01 08:27:30 +01:00
itmt.c
jailhouse.c
jump_label.c jump_labels: Mark __jump_label_transform() as __always_inlined to work around aggressive compiler un-inlining 2021-07-13 06:32:05 +02:00
kdebugfs.c x86/boot: Fix memremap of setup_indirect structures 2022-03-16 14:23:45 +01:00
kexec-bzimage64.c x86: Use ELF fields defined in 'struct kimage' 2021-03-08 12:06:29 -07:00
kgdb.c x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
ksysfs.c x86/boot: Fix memremap of setup_indirect structures 2022-03-16 14:23:45 +01:00
kvm.c x86, kvm: use proper ASM macros for kvm_vcpu_is_preempted 2022-07-02 16:41:12 +02:00
kvmclock.c x86/kvm: Do not try to disable kvmclock if it was not enabled 2024-01-25 14:52:49 -08:00
ldt.c memcg: enable accounting for ldt_struct objects 2021-09-03 09:58:13 -07:00
machine_kexec_32.c x86/kexec: Set_[gi]dt() -> native_[gi]dt_invalidate() in machine_kexec_*.c 2021-05-21 12:36:45 +02:00
machine_kexec_64.c x86/kexec: fix memory leak of elf header buffer 2022-06-09 10:22:29 +02:00
Makefile x86/sev: Add an x86 version of cc_platform_has() 2021-11-18 19:17:21 +01:00
mmconf-fam10h_64.c x86/msr: Rename MSR_K8_SYSCFG to MSR_AMD64_SYSCFG 2021-05-10 07:51:38 +02:00
module.c x86: Undo return-thunk damage 2022-07-23 12:53:58 +02:00
mpparse.c x86: Avoid magic number with ELCR register accesses 2021-08-10 23:31:43 +02:00
msr.c
nmi_selftest.c
nmi.c x86/bugs: Use ALTERNATIVE() instead of mds_user_clear static key 2024-04-10 16:18:48 +02:00
paravirt-spinlocks.c x86/paravirt: Add new features for paravirt patching 2021-03-11 19:51:49 +01:00
paravirt.c x86/ibt,paravirt: Use text_gen_insn() for paravirt_patch() 2024-03-01 13:21:49 +01:00
pci-dma.c
pci-iommu_table.c
pci-swiotlb.c
pcspeaker.c
perf_regs.c
platform-quirks.c
pmem.c x86/pmem: Fix platform-device leak in error path 2022-08-17 14:23:07 +02:00
probe_roms.c
process_32.c x86/resctl: fix scheduler confusion with 'current' 2023-03-11 13:57:39 +01:00
process_64.c x86/cpu: Fix check for RDPKRU in __show_regs() 2024-05-02 16:24:47 +02:00
process.c x86: Mark stop_this_cpu() __noreturn 2023-03-10 09:39:12 +01:00
process.h
ptrace.c x86/ptrace: Fix xfpregs_set()'s incorrect xmm clearing 2022-03-02 11:47:47 +01:00
pvclock.c x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
quirks.c
reboot_fixups_32.c
reboot.c x86/reboot: Disable virtualization in an emergency if SVM is supported 2023-03-10 09:40:01 +01:00
relocate_kernel_32.S x86/kexec: Disable RET on kexec 2022-07-23 12:54:11 +02:00
relocate_kernel_64.S x86/kexec: Disable RET on kexec 2022-07-23 12:54:11 +02:00
resource.c
rtc.c
setup_percpu.c memblock: introduce saner 'memblock_free_ptr()' interface 2021-09-14 13:23:22 -07:00
setup.c x86/mm: Fix RESERVE_BRK() for older binutils 2023-11-08 17:26:43 +01:00
sev_verify_cbit.S x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
sev-shared.c x86/sev: Check for user-space IOIO pointing to kernel space 2023-10-25 11:58:55 +02:00
sev.c x86/sev: Check IOBM for IOIO exceptions from user-space 2023-10-25 11:58:55 +02:00
signal_compat.c signal: Deliver SIGTRAP on perf event asynchronously if blocked 2022-06-09 10:22:48 +02:00
signal.c x86/init: Initialize signal frame size late 2023-08-08 19:58:31 +02:00
smp.c x86/reboot: Disable SVM, not just VMX, when stopping CPUs 2023-03-10 09:40:01 +01:00
smpboot.c x86/smp: Use dedicated cache-line for mwait_play_dead() 2023-07-05 18:25:05 +01:00
stacktrace.c stacktrace: Move documentation for arch_stack_walk_reliable() to header 2021-03-10 15:52:31 +01:00
static_call.c x86/static_call: Add support for Jcc tail-calls 2024-04-10 16:18:49 +02:00
step.c ptrace: Reimplement PTRACE_KILL by always sending SIGKILL 2022-06-09 10:22:29 +02:00
sys_ia32.c
sys_x86_64.c x86/mm: Cleanup the control_va_addr_alignment() __setup handler 2022-06-09 10:22:54 +02:00
tboot.c x86/boot/tboot: Avoid Wstringop-overread-warning 2021-03-23 00:16:13 +01:00
time.c
tls.c x86/stackprotector/32: Make the canary into a regular percpu variable 2021-03-08 13:19:05 +01:00
tls.h
topology.c x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
trace_clock.c
trace.c trace/osnoise: Fix 'no previous prototype' warnings 2021-06-28 14:12:26 -04:00
tracepoint.c
traps.c x86/CPU/AMD: Fix the DIV(0) initial fix attempt 2023-08-26 14:23:40 +02:00
tsc_msr.c
tsc_sync.c x86/tsc: Trust initial offset in architectural TSC-adjust MSRs 2024-06-16 13:39:11 +02:00
tsc.c x86/tsc: Disable clocksource watchdog for TSC on qualified platorms 2021-12-08 09:04:56 +01:00
umip.c x86/insn: Extend error reporting from insn_fetch_from_user[_inatomic]() 2021-06-15 11:39:30 +02:00
unwind_frame.c
unwind_guess.c
unwind_orc.c x86/unwind/orc: Fix unreliable stack dump with gcov 2022-11-03 23:59:16 +09:00
uprobes.c uprobes/x86: Allow to probe a NOP instruction with 0x66 prefix 2022-12-31 13:14:04 +01:00
verify_cpu.S x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
vm86_32.c signal: Replace force_fatal_sig with force_exit_sig when in doubt 2021-11-25 09:49:07 +01:00
vmlinux.lds.S x86: Fix .brk attribute in linker script 2023-11-08 17:26:44 +01:00
vsmp_64.c
x86_init.c x86/rtc: Remove __init for runtime functions 2023-04-20 12:13:56 +02:00