From: Dongxiao Xu Date: Thu, 6 Dec 2012 16:54:26 +0000 (+0000) Subject: nested vmx: fix rflags status in virtual vmexit X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~7552 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3d605ee7378409ed1d52a0591df963313bb8b4c5;p=xen.git nested vmx: fix rflags status in virtual vmexit 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 Signed-off-by: Dongxiao Xu Acked-by: Jan Beulich Committed-by: Keir Fraser --- diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index ec5e8a74f2..d8b7ce58c7 100644 --- a/xen/arch/x86/hvm/vmx/vvmx.c +++ b/xen/arch/x86/hvm/vmx/vvmx.c @@ -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);