From mboxrd@z Thu Jan 1 00:00:00 1970 From: NAHieu Subject: Re: HVM context Date: Thu, 15 Oct 2009 11:55:29 +0900 Message-ID: <5d7aca950910141955u8681cd0vb59608c5eb313860@mail.gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Sat, Oct 10, 2009 at 3:27 PM, Keir Fraser wr= ote: > On 09/10/2009 22:47, "Eads, Joshua Michael (S&T-Student)" > wrote: > >> I have an HVM guest and I am trying to have a usermode program in Dom0 q= uery >> the context (CPU registers, specifically) of the guest. >> >> I first tried using xc_domain_getcontext() in xenctrl.h but I haven't fi= gured >> out what data structure ctxt_buf is that it returns. =A0Next, I have tri= ed using >> xc_vcpu_getcontext() in xenctrl.h but so far it always returns -1 for fa= ilure. >> 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 o= f > 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