]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: nVMX: Allow emulating RDPID on behalf of L2
authorSean Christopherson <seanjc@google.com>
Sat, 1 Feb 2025 01:55:10 +0000 (17:55 -0800)
committerSean Christopherson <seanjc@google.com>
Mon, 24 Feb 2025 17:01:06 +0000 (09:01 -0800)
commit3244616aac8dc69b3d7e4a4ee541e767b974af43
treef90993c0113858263946a4d9d8f2359c193bed94
parentc8e612bfedff67da0dd4abdf4de9ce7671b89f71
KVM: nVMX: Allow emulating RDPID on behalf of L2

Return X86EMUL_CONTINUE instead X86EMUL_UNHANDLEABLE when emulating RDPID
on behalf of L2 and L1 _does_ expose RDPID/RDTSCP to L2.  When RDPID
emulation was added by commit fb6d4d340e05 ("KVM: x86: emulate RDPID"),
KVM incorrectly allowed emulation by default.  Commit 07721feee46b ("KVM:
nVMX: Don't emulate instructions in guest mode") fixed that flaw, but
missed that RDPID emulation was relying on the common return path to allow
emulation on behalf of L2.

Fixes: 07721feee46b ("KVM: nVMX: Don't emulate instructions in guest mode")
Link: https://lore.kernel.org/r/20250201015518.689704-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/vmx.c