]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Check GUEST_DR7 on vmentry of nested guests
authorKrish Sadhukhan <krish.sadhukhan@oracle.com>
Thu, 16 Jan 2020 00:54:32 +0000 (19:54 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 27 Jan 2020 18:59:55 +0000 (19:59 +0100)
commit22722111783a117cb0f1c2c4acd303d31e2de8ea
treea27309345c916f18b7452f5224bc0715ceaf05c7
parentbc3fe77f3d02c64f5a524797b3912e2e5a259bbc
KVM: nVMX: Check GUEST_DR7 on vmentry of nested guests

According to section "Checks on Guest Control Registers, Debug Registers, and
and MSRs" in Intel SDM vol 3C, the following checks are performed on vmentry
of nested guests:

    If the "load debug controls" VM-entry control is 1, bits 63:32 in the DR7
    field must be 0.

In KVM, GUEST_DR7 is set prior to the vmcs02 VM-entry by kvm_set_dr() and the
latter synthesizes a #GP if any bit in the high dword in the former is set.
Hence this field needs to be checked in software.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h