]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
KVM: X86: Use kvm_get_linear_rip() in single-step and #DB/#BP interception
authorYuan Yao <yuan.yao@intel.com>
Wed, 26 May 2021 06:38:28 +0000 (14:38 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 28 May 2021 16:57:53 +0000 (12:57 -0400)
commite87e46d5f3182f82d997641d95db01a7feacef92
tree0ec68c48d12117df758bc4c0545664a22ecc32a2
parentbedd9195df3dfea7165e7d6f7519a1568bc41936
KVM: X86: Use kvm_get_linear_rip() in single-step and #DB/#BP interception

The kvm_get_linear_rip() handles x86/long mode cases well and has
better readability, __kvm_set_rflags() also use the paired
function kvm_is_linear_rip() to check the vcpu->arch.singlestep_rip
set in kvm_arch_vcpu_ioctl_set_guest_debug(), so change the
"CS.BASE + RIP" code in kvm_arch_vcpu_ioctl_set_guest_debug() and
handle_exception_nmi() to this one.

Signed-off-by: Yuan Yao <yuan.yao@intel.com>
Message-Id: <20210526063828.1173-1-yuan.yao@linux.intel.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c