Re: [PATCH] x86/entry/64: Disallow RDPID in paranoid entry if KVM is enabled

From: Borislav Petkov
Date: Fri Aug 21 2020 - 03:47:46 EST


On Thu, Aug 20, 2020 at 07:50:50PM -0700, Sean Christopherson wrote:
> + * Disallow RDPID if KVM is enabled as it may consume a guest's TSC_AUX
> + * if an NMI arrives in KVM's run loop. KVM loads guest's TSC_AUX on
> + * VM-Enter and may not restore the host's value until the CPU returns
> + * to userspace, i.e. KVM depends on the kernel not using TSC_AUX.
> */

And frankly, this is really unfair. The kernel should be able to use any
MSR. IOW, KVM needs to be fixed here. I'm sure it context-switches other
MSRs so one more MSR is not a big deal.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette