KVM: VMX: Check cpl before emulating debug register access
commit0373fc0c209db541ec115700fbdb50e85b774a02
authorAvi Kivity <avi@redhat.com>
Fri, 18 Sep 2009 23:07:59 +0000 (18 20:07 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 15:27:52 +0000 (5 08:27 -0700)
tree02bd0b424d82b646eed98eb3ee0410f9cffb90d3
parentcb2a1b63162335f8a693fcbd6317e23b675a1970
KVM: VMX: Check cpl before emulating debug register access

(cherry picked from commit 0a79b009525b160081d75cef5dbf45817956acf2)

Debug registers may only be accessed from cpl 0.  Unfortunately, vmx will
code to emulate the instruction even though it was issued from guest
userspace, possibly leading to an unexpected trap later.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c