Mailing List Archive

Debug Exception Handling in Linux

I'm trying to single-step processes in a HVM Linux guest using Xen on Intel VT. Especially i've changed the Ether patch for Xen to be able to handle Linux guests. My Problem is that every single step the RIP stored in the VMCS points to kernel instructions (>0xC0000000) and thus only kernel instructions are stepped. To achieve single-stepping, both the exception bitmap and the rflags are masked with the trap flag, debug register 6's 14th bit is set (single-stepping) and the exception is send to the guest using

vmx_inject_hw_exception(v, TRAP_debug, VMX_DELIVER_NO_ERROR_CODE);

Has anybody a clue why the RIP points to kernel instructions or where the userland RIP is stored at this time? To avoid misunderstandings, i'm not searching for Xen specific answers. It would be very helpful if you could enlight me how the linux kernel handles debug exceptions or where the userland RIP is stored.

Kind regards

PS: Please add my address to CC

Ether patch:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at