]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86/emulator: Emulate RDPID only if it is enabled in guest
authorHou Wenlong <houwenlong.hwl@antgroup.com>
Wed, 2 Mar 2022 13:15:14 +0000 (21:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:02:56 +0000 (20:02 +0200)
commitb8b5e589e1f951f7b9840b99607ffd29515492a1
tree9ad42648ff3803f530930bd583c39eb49f34654d
parent98dc2c3a286f1d72b1edc332eb5795917472b49c
KVM: x86/emulator: Emulate RDPID only if it is enabled in guest

[ Upstream commit a836839cbfe60dc434c5476a7429cf2bae36415d ]

When RDTSCP is supported but RDPID is not supported in host,
RDPID emulation is available. However, __kvm_get_msr() would
only fail when RDTSCP/RDPID both are disabled in guest, so
the emulator wouldn't inject a #UD when RDPID is disabled but
RDTSCP is enabled in guest.

Fixes: fb6d4d340e05 ("KVM: x86: emulate RDPID")
Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
Message-Id: <1dfd46ae5b76d3ed87bde3154d51c64ea64c99c1.1646226788.git.houwenlong.hwl@antgroup.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/emulate.c
arch/x86/kvm/kvm_emulate.h
arch/x86/kvm/x86.c