From patchwork Sun Mar 3 19:47:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 2208701 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D15BCDF215 for ; Sun, 3 Mar 2013 19:47:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753631Ab3CCTrP (ORCPT ); Sun, 3 Mar 2013 14:47:15 -0500 Received: from mout.web.de ([212.227.15.3]:53367 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753336Ab3CCTrP (ORCPT ); Sun, 3 Mar 2013 14:47:15 -0500 Received: from mchn199C.mchp.siemens.de ([95.157.56.37]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0M1oGM-1V4bqk1OtW-00tA6n; Sun, 03 Mar 2013 20:47:12 +0100 Message-ID: <5133A8BF.1010607@web.de> Date: Sun, 03 Mar 2013 20:47:11 +0100 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Gleb Natapov , Marcelo Tosatti CC: kvm , Nadav Har'El , "Nakajima, Jun" Subject: [PATCH v2] KVM: nVMX: Reset RFLAGS on VM-exit X-Enigmail-Version: 1.5 X-Provags-ID: V02:K0:6T4E+gF7oEg+6bhMAxsvrECZYTtDKMRWPvHKZ3uGQax MKX8AmlEvdDeRAQjI0i9eN10XnsaF4CHHTcqKj6QGHfIYNwVDI nKX5l4aNRFHUG/PTKHtobT1CqFTyXufWDqMSQeXHjhu6pwXKzm /w/F0Xv3uoQa2V6++BnQ4EN+Fxco8VT34mk8Sh+1mamlVq+IO7 tUzPgObyO//IQm8kifXoQ== Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jan Kiszka Ouch, how could this work so well that far? We need to clear RFLAGS to the reset value as specified by the SDM. Particularly, IF must be off after VM-exit! Signed-off-by: Jan Kiszka Reviewed-by: Gleb Natapov --- Changes in v2: - use symbolic constant for rflags reset value arch/x86/kvm/vmx.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 486078d..eece4c8 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -7454,6 +7454,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu, kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->host_rsp); kvm_register_write(vcpu, VCPU_REGS_RIP, vmcs12->host_rip); + vmx_set_rflags(vcpu, X86_EFLAGS_BIT1); /* * Note that calling vmx_set_cr0 is important, even if cr0 hasn't * actually changed, because it depends on the current state of