xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* (no subject)
@ 2009-10-09 21:47 Eads, Joshua Michael (S&T-Student)
  2009-10-10  6:27 ` HVM context Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: Eads, Joshua Michael (S&T-Student) @ 2009-10-09 21:47 UTC (permalink / raw)
  To: xen-devel

I have an HVM guest and I am trying to have a usermode program in Dom0 query the context (CPU registers, specifically) of the guest.  

I first tried using xc_domain_getcontext() in xenctrl.h but I haven't figured out what data structure ctxt_buf is that it returns.  Next, I have tried using xc_vcpu_getcontext() in xenctrl.h but so far it always returns -1 for failure.  For xc_vcpu_getcontext, I am passing in a vcpu number of 1 (I only have a single virtual CPU domU running) along with an unallocated vcpu_guest_context_t pointer.

Is this the right direction to pull guest registers, or is there another method I need to use to get the HVM guest context?

Thanks,
Josh

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

* Re: HVM context
  2009-10-09 21:47 (no subject) Eads, Joshua Michael (S&T-Student)
@ 2009-10-10  6:27 ` Keir Fraser
  2009-10-10 14:34   ` Dan Magenheimer
  2009-10-15  2:55   ` NAHieu
  0 siblings, 2 replies; 5+ messages in thread
From: Keir Fraser @ 2009-10-10  6:27 UTC (permalink / raw)
  To: Eads, Joshua Michael (S&T-Student), xen-devel

On 09/10/2009 22:47, "Eads, Joshua Michael (S&T-Student)" <jmer43@mst.edu>
wrote:

> I have an HVM guest and I am trying to have a usermode program in Dom0 query
> the context (CPU registers, specifically) of the guest.
> 
> I first tried using xc_domain_getcontext() in xenctrl.h but I haven't figured
> out what data structure ctxt_buf is that it returns.  Next, I have tried using
> xc_vcpu_getcontext() in xenctrl.h but so far it always returns -1 for failure.
> For xc_vcpu_getcontext, I am passing in a vcpu number of 1 (I only have a
> single virtual CPU domU running) along with an unallocated
> vcpu_guest_context_t pointer.
> 
> Is this the right direction to pull guest registers, or is there another
> method I need to use to get the HVM guest context?

For an HVM guest you can use xc_domain_hvm_getcontext() or
xc_domain_hvm_getcontext_partial(). You then have to pick apart the bag of
bytes you get back. The save format is documented to some extent in
xen/include/public/arch-x86/hvm/save.h

 -- Keir

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

* RE: HVM context
  2009-10-10  6:27 ` HVM context Keir Fraser
@ 2009-10-10 14:34   ` Dan Magenheimer
  2009-10-15  2:55   ` NAHieu
  1 sibling, 0 replies; 5+ messages in thread
From: Dan Magenheimer @ 2009-10-10 14:34 UTC (permalink / raw)
  To: Keir Fraser, Eads, Joshua Michael (S&T-Student), xen-devel

> > I have an HVM guest and I am trying to have a usermode 
> program in Dom0 query
> > the context (CPU registers, specifically) of the guest.
> > 
> > I first tried using xc_domain_getcontext() in xenctrl.h but 
> I haven't figured
> > out what data structure ctxt_buf is that it returns.  Next, 
> I have tried using
> > xc_vcpu_getcontext() in xenctrl.h but so far it always 
> returns -1 for failure.
> > For xc_vcpu_getcontext, I am passing in a vcpu number of 1 
> (I only have a
> > single virtual CPU domU running) along with an unallocated
> > vcpu_guest_context_t pointer.
> > 
> > Is this the right direction to pull guest registers, or is 
> there another
> > method I need to use to get the HVM guest context?
> 
> For an HVM guest you can use xc_domain_hvm_getcontext() or
> xc_domain_hvm_getcontext_partial(). You then have to pick 
> apart the bag of
> bytes you get back. The save format is documented to some extent in
> xen/include/public/arch-x86/hvm/save.h

Or you can use (or steal code from) the very nice tool
that Tim Deegan wrote, xen-hvmctx, which is included
in the xen-unstable source at tools/misc/xen-hvmctx.c.

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

* Re: HVM context
  2009-10-10  6:27 ` HVM context Keir Fraser
  2009-10-10 14:34   ` Dan Magenheimer
@ 2009-10-15  2:55   ` NAHieu
  2009-10-15  6:47     ` Keir Fraser
  1 sibling, 1 reply; 5+ messages in thread
From: NAHieu @ 2009-10-15  2:55 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

On Sat, Oct 10, 2009 at 3:27 PM, Keir Fraser <keir.fraser@eu.citrix.com> wrote:
> On 09/10/2009 22:47, "Eads, Joshua Michael (S&T-Student)" <jmer43@mst.edu>
> wrote:
>
>> I have an HVM guest and I am trying to have a usermode program in Dom0 query
>> the context (CPU registers, specifically) of the guest.
>>
>> I first tried using xc_domain_getcontext() in xenctrl.h but I haven't figured
>> out what data structure ctxt_buf is that it returns.  Next, I have tried using
>> xc_vcpu_getcontext() in xenctrl.h but so far it always returns -1 for failure.
>> For xc_vcpu_getcontext, I am passing in a vcpu number of 1 (I only have a
>> single virtual CPU domU running) along with an unallocated
>> vcpu_guest_context_t pointer.
>>
>> Is this the right direction to pull guest registers, or is there another
>> method I need to use to get the HVM guest context?
>
> For an HVM guest you can use xc_domain_hvm_getcontext() or
> xc_domain_hvm_getcontext_partial(). You then have to pick apart the bag of
> bytes you get back. The save format is documented to some extent in
> xen/include/public/arch-x86/hvm/save.h

So that means xc_vcpu_getcontext() is only valid for PV domains?

Thanks,
H

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

* Re: HVM context
  2009-10-15  2:55   ` NAHieu
@ 2009-10-15  6:47     ` Keir Fraser
  0 siblings, 0 replies; 5+ messages in thread
From: Keir Fraser @ 2009-10-15  6:47 UTC (permalink / raw)
  To: NAHieu; +Cc: xen-devel

On 15/10/2009 03:55, "NAHieu" <nahieu@gmail.com> wrote:

>> For an HVM guest you can use xc_domain_hvm_getcontext() or
>> xc_domain_hvm_getcontext_partial(). You then have to pick apart the bag of
>> bytes you get back. The save format is documented to some extent in
>> xen/include/public/arch-x86/hvm/save.h
> 
> So that means xc_vcpu_getcontext() is only valid for PV domains?

It's usefulness is certainly limited.

 -- Keir

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

end of thread, other threads:[~2009-10-15  6:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-09 21:47 (no subject) Eads, Joshua Michael (S&T-Student)
2009-10-10  6:27 ` HVM context Keir Fraser
2009-10-10 14:34   ` Dan Magenheimer
2009-10-15  2:55   ` NAHieu
2009-10-15  6:47     ` Keir Fraser

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 NNTP newsgroup(s).