From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dongxiao Xu Subject: [PATCH 03/10] nested vmx: fix rflags status in virtual vmexit Date: Tue, 4 Dec 2012 13:53:23 +0800 Message-ID: <1354600410-3390-4-git-send-email-dongxiao.xu@intel.com> References: <1354600410-3390-1-git-send-email-dongxiao.xu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1354600410-3390-1-git-send-email-dongxiao.xu@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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 --- xen/arch/x86/hvm/vmx/vvmx.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index cf91c7c..6a8caaa 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); + /*VMexit clears all bits except bit 1!*/ + regs->eflags = 2; /* updating host cr0 to sync TS bit */ __vmwrite(HOST_CR0, v->arch.hvm_vmx.host_cr0); -- 1.7.1