Skip to content

Commit d5d260c

Browse files
xzpeterbonzini
authored andcommitted
KVM: X86: Fix single-step with KVM_SET_GUEST_DEBUG
When single-step triggered with KVM_SET_GUEST_DEBUG, we should fill in the pc value with current linear RIP rather than the cached singlestep address. Signed-off-by: Peter Xu <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 1319663 commit d5d260c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6662,7 +6662,7 @@ static int kvm_vcpu_do_singlestep(struct kvm_vcpu *vcpu)
66626662

66636663
if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP) {
66646664
kvm_run->debug.arch.dr6 = DR6_BS | DR6_FIXED_1 | DR6_RTM;
6665-
kvm_run->debug.arch.pc = vcpu->arch.singlestep_rip;
6665+
kvm_run->debug.arch.pc = kvm_get_linear_rip(vcpu);
66666666
kvm_run->debug.arch.exception = DB_VECTOR;
66676667
kvm_run->exit_reason = KVM_EXIT_DEBUG;
66686668
return 0;

0 commit comments

Comments
 (0)