About VMX VMExit handler
Hi,
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?
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?
Thanks,
Wu
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 7 lines
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.
Quoted 4 lines
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