Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: x86 emulator: fix RDPMC privilege check

RDPMC is only privileged if CR4.PCE=0. check_rdpmc() already implements this,
so all we need to do is drop the Priv flag.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>

+1 -1
+1 -1
arch/x86/kvm/emulate.c
··· 3411 3411 II(ImplicitOps | Priv, em_wrmsr, wrmsr), 3412 3412 IIP(ImplicitOps, em_rdtsc, rdtsc, check_rdtsc), 3413 3413 II(ImplicitOps | Priv, em_rdmsr, rdmsr), 3414 - DIP(ImplicitOps | Priv, rdpmc, check_rdpmc), 3414 + DIP(ImplicitOps, rdpmc, check_rdpmc), 3415 3415 I(ImplicitOps | VendorSpecific, em_sysenter), 3416 3416 I(ImplicitOps | Priv | VendorSpecific, em_sysexit), 3417 3417 N, N,