1

On the x86 platform, the int 3 instruction causes a breakpoint trap. For KVM, the Virtual CPUs can be configured to exit to the hypervisor on this trap, by enabling the flags KVM_GUESTDBG_ENABLE and KVM_GUESTDBG_USE_SW_BP (see KVM documentation). When the VM exits, I would like to step over the instruction and continue execution, without the guest VM being notified of the breakpoint trap.

I have tried the following:

  1. Enable KVM_GUESTDBG_USE_SW_BP and KVM_GUESTDBG_ENABLE, wait for the breakpoint trap exit to occur
  2. Disable KVM_GUESTDBG_USE_SW_BP and enable KVM_GUESTDBG_SINGLESTEP
  3. Resume the vCPU to step over the int 3 instruction and generate another VM exit
  4. enable KVM_GUESTDBG_USE_SW_BP and disable KVM_GUESTDBG_SINGLESTEP to continue normal execution

This approach however fails to isolate the debug breakpoint trap from the guest VM, and the guest OS will receive the exception. Enabling KVM_GUESTDBG_BLOCKIRQ does not prevent this either.

Upon the first generated VM exit, how does one correctly step over a software-induced breakpoint trap, without leaking the breakpoint trap to the guest VM?

New contributor
David is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.