[PATCH 0/2] x86/cpu: RDPID+MSR_TSC_AUX fix and a cleanup

From: Sean Christopherson
Date: Tue May 04 2021 - 18:56:52 EST


Fix a bug where MSR_TSC_AUX is left uninitialized in the theoretically
possible scenario where RDPID is supported by RDTSCP is not. AFAIK, no
such CPUs exits, but both Intel and AMD architecturally allow RDPID and
MSR_TSC_AUX to exist without RDTSCP.

Found by inspection when cleaning up a similar mess in KVM. Confirmed
the bug and verified the fix by running the problematic CPU model under
KVM (once KVM's even bigger trainwreck was fixed).

Sean Christopherson (2):
x86/cpu: Initialize MSR_TSC_AUX if RDTSCP *or* RDPID is supported
x86/cpu: Remove write_tsc() and write_rdtscp_aux() wrappers

arch/x86/include/asm/msr.h | 4 ----
arch/x86/kernel/cpu/common.c | 4 ++--
2 files changed, 2 insertions(+), 6 deletions(-)

--
2.31.1.527.g47e6f16901-goog