WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] About VMX VMExit handler

To: Wu Bingzheng <wubingzheng@xxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] About VMX VMExit handler
From: "Li, Xin" <xin.li@xxxxxxxxx>
Date: Wed, 20 May 2009 16:16:42 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Wed, 20 May 2009 01:17:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <32585582.867861242805446506.JavaMail.coremail@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <32585582.867861242805446506.JavaMail.coremail@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcnZHthQHeoCFHjCSem76TuzZHCDmwAA8PfQ
Thread-topic: [Xen-devel] About VMX VMExit handler
>In VM Exit handler, vmx_asm_vmexit_handler(),
>[xen-3.3.0/xen/arch/x86/hvm/vmx/entry.S:line65], it first saves
>guest's RIP, RSP, RFLAGS from VMCS to stack by VMREAD,
>then call vmx_vmexit_handler, and then recover guest's RIP, RSP and RFLAGS.

>1. The VMCS is designed to save these registers,
>why need to save them into stack still?

These fields may be changed by common code, like shadow, you don't want to 
Update VMCS directly in shadow code, or you'll need arch specific function 
pointers in shadow.

>2. What should I do, if I want to change the guest's RIP
>in vmx_vmexit_handler(), in order to let the guest load the
>new RIP on VM Entry? It doesn't work of changing the RIP
>in VMCS. Do I have to change the RIP in the stack?

Yes, we have __update_guest_eip for that purpose.
Thanks!
-Xin

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>