Hello everybody,
I 'm using gdb to debug an hypervisor. and my goal is to trace the program
execution starting from the point that the hypervisor launches the guest OS
by "VMRUN" instruction so that I can jump to the first instruction in the
guest OS code.
This is an excerpt from the hypervisor code:
                clgi;
                sti;
                vmload;
                vmrun;  // starting from here, the cpu switch on
virtualization and the Guest OS is fecthed
                vmsave; // this is the first instruction after a VMEXIT

So, according to AMD documentation
<https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjnhK_OtNTLAhXLQBQKHSPMDkwQFggdMAA&url=http%3A%2F%2Fdeveloper.amd.com%2Fwordpress%2Fmedia%2F2012%2F10%2F24593_APM_v21.pdf&usg=AFQjCNEX5XAf-n3GwD42jrkvbxEE3wTb-Q&sig2=RoUdIe_BYVBCT9eGvKp9Ew>,
the next instruction after VMRUN is at CS:RIP where CS and RIP are
extracted from the VMCB specific field.
But using gdb, when I step one instruction from VMRUN, the next instruction
fechted by the debugger is the next instruction in the hypervisor code,
that is "VMSAVE", not the OS code.
So my problem is to trace the execution from the host code to the guest
code.
How can I do that? Is there anyone who faced such a kind of problem?
Hope I can get help from YOU. Thanks

-- 
Parfait T.

Reply via email to