Re: [PATCH] KVM: x86: respect singlestep when emulating instruction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18/05/20 23:36, Felipe Franciosi wrote:
>  		    exception_type(ctxt->exception.vector) == EXCPT_TRAP) {
>  			kvm_rip_write(vcpu, ctxt->eip);
> -			if (r && ctxt->tf)
> +			if ((r && ctxt->tf) || (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP))
>  				r = kvm_vcpu_do_singlestep(vcpu);

Almost:

	if (r && (ctxt->tf || (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP))

This is because if r == 0 you have to exit to userspace with KVM_EXIT_MMIO
and KVM_EXIT_IO before completing execution of the instruction.  Once
this is done, you'll get here again and you'll be able to go through
kvm_vcpu_do_singlestep.

Thanks,

Paolo




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux