public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Re: Using gdb, how to step only one machine instruction after vmrun instruction? ...so that I jump in the guest OS code
       [not found] <CAOfT3nHaoBptrjZoYg3V2BenbYUmu36-3-MXnx9SanmnkpDxbA@mail.gmail.com>
@ 2016-03-23 13:50 ` Parfait Tokponnon
  0 siblings, 0 replies; 2+ messages in thread
From: Parfait Tokponnon @ 2016-03-23 13:50 UTC (permalink / raw)
  To: gdb

2016-03-23 14:45 GMT+01:00 Parfait Tokponnon <parfait.tokponnon@gmail.com>:
> Hello,
> 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, 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.



-- 
Parfait T.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Using gdb, how to step only one machine instruction after vmrun instruction? ...so that I jump in the guest OS code
@ 2016-03-23 13:51 Parfait Tokponnon
  0 siblings, 0 replies; 2+ messages in thread
From: Parfait Tokponnon @ 2016-03-23 13:51 UTC (permalink / raw)
  To: gdb

Hello,
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, 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-23 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAOfT3nHaoBptrjZoYg3V2BenbYUmu36-3-MXnx9SanmnkpDxbA@mail.gmail.com>
2016-03-23 13:50 ` Using gdb, how to step only one machine instruction after vmrun instruction? ...so that I jump in the guest OS code Parfait Tokponnon
2016-03-23 13:51 Parfait Tokponnon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).