Re: [PATCH] x86: Drop RDPID macro to discourage use of RDPID in the kernel

2020-10-28 Thread Peter Zijlstra
On Tue, Oct 27, 2020 at 02:45:32PM -0700, Sean Christopherson wrote: > Drop the GAS-compatible RDPID macro as RDPID shouldn't be used in the > kernel, excepting the vDSO, which handcodes RDPID in inline asm. RDPID > is unsafe in the kernel because KVM loads guest's TSC_AUX on VM-entry > and may

[PATCH] x86: Drop RDPID macro to discourage use of RDPID in the kernel

2020-10-27 Thread Sean Christopherson
Drop the GAS-compatible RDPID macro as RDPID shouldn't be used in the kernel, excepting the vDSO, which handcodes RDPID in inline asm. RDPID is unsafe in the kernel because KVM loads guest's TSC_AUX on VM-entry and may not restore the host's value until the CPU returns to userspace. See commit