]> xenbits.xensource.com Git - people/aperard/xen-arm.git/commitdiff
nested vmx: fix rflags status in virtual vmexit
authorDongxiao Xu <dongxiao.xu@intel.com>
Thu, 6 Dec 2012 16:54:26 +0000 (16:54 +0000)
committerDongxiao Xu <dongxiao.xu@intel.com>
Thu, 6 Dec 2012 16:54:26 +0000 (16:54 +0000)
As stated in SDM, all bits (except for those 1-reserved) in rflags
would be set to 0 in VM exit. Therefore we need to follow this logic
in virtual_vmexit.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/vmx/vvmx.c

index ec5e8a74f267c702b1cf278625574d5dff259a39..d8b7ce58c7e6fc872a1cfe71822c2c9ad8b46c0e 100644 (file)
@@ -991,7 +991,8 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
 
     regs->eip = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RIP);
     regs->esp = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RSP);
-    regs->eflags = __vmread(GUEST_RFLAGS);
+    /* VM exit clears all bits except bit 1 */
+    regs->eflags = 0x2;
 
     /* updating host cr0 to sync TS bit */
     __vmwrite(HOST_CR0, v->arch.hvm_vmx.host_cr0);