KVM: x86: move kvm_inject_gp up from kvm_set_dr to callers
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 14 Dec 2020 12:49:54 +0000 (07:49 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 9 Feb 2021 13:17:07 +0000 (08:17 -0500)
commit996ff5429e9898947016206ee9da387a93d63d9d
tree93efdb570615ef46730baa52dd8bf6c1e3466c16
parent29d6ca41992a771e2441424099695c329d735c28
KVM: x86: move kvm_inject_gp up from kvm_set_dr to callers

Push the injection of #GP up to the callers, so that they can just use
kvm_complete_insn_gp. __kvm_set_dr is pretty much what the callers can use
together with kvm_complete_insn_gp, so rename it to kvm_set_dr and drop
the old kvm_set_dr wrapper.

This also allows nested VMX code, which really wanted to use __kvm_set_dr,
to use the right function.

While at it, remove the kvm_require_dr() check from the SVM interception.
The APM states:

  All normal exception checks take precedence over the SVM intercepts.

which includes the CR4.DE=1 #UD.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c