From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753443AbbJUG2g (ORCPT ); Wed, 21 Oct 2015 02:28:36 -0400 Received: from blu004-omc1s25.hotmail.com ([65.55.116.36]:64409 "EHLO BLU004-OMC1S25.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182AbbJUG2e (ORCPT ); Wed, 21 Oct 2015 02:28:34 -0400 X-TMN: [sZr60t/xsmvvd6A+mNUDd0C6awsBBS1N] X-Originating-Email: [wanpeng.li@hotmail.com] Message-ID: From: Wanpeng Li To: Paolo Bonzini CC: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH] KVM: x86: fix eflags state following processor init/reset Date: Wed, 21 Oct 2015 14:28:25 +0800 X-Mailer: git-send-email 1.9.1 X-OriginalArrivalTime: 21 Oct 2015 06:28:32.0096 (UTC) FILETIME=[B4D9CE00:01D10BC9] MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reference SDM 3.4.3: Following initialization of the processor (either by asserting the RESET pin or the INIT pin), the state of the EFLAGS register is 00000002H. However, the eflags fixed bit is not set and other bits are also not cleared during the init/reset in kvm. This patch fix it by set eflags register to 00000002H following initialization of the processor. Signed-off-by: Wanpeng Li --- arch/x86/kvm/vmx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index b680c2e..326f6ea 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -4935,6 +4935,7 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) vmx_set_efer(vcpu, 0); vmx_fpu_activate(vcpu); update_exception_bitmap(vcpu); + vmx_set_rflags(vcpu, X86_EFLAGS_FIXED); vpid_sync_context(vmx->vpid); } -- 1.9.1