From: Nadav Har'El Subject: Re: [PATCH] KVM: nVMX: Reset RFLAGS on VM-exit Date: Sun, 3 Mar 2013 21:15:05 +0200 Message-ID: <20130303191505.GA32596@fermat.math.technion.ac.il> References: <51333CDC.4040609@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Gleb Natapov , Marcelo Tosatti , kvm , "Nakajima, Jun" To: Jan Kiszka Return-path: Received: from mailgw13.technion.ac.il ([132.68.225.13]:65298 "EHLO mailgw13.technion.ac.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753336Ab3CCTRV (ORCPT ); Sun, 3 Mar 2013 14:17:21 -0500 Content-Disposition: inline In-Reply-To: <51333CDC.4040609@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Mar 03, 2013, Jan Kiszka wrote about "[PATCH] KVM: nVMX: Reset RFLAGS on VM-exit": > 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! nested_vmx_succeed() or nested_vmx_fail*() were already clearing some of the fields that I understood was necessary to clear. But they did not clear the IF - I never realised (and didn't verify now) that this is part of the spec. And since L1 KVM anyways enters L2 with interrupts disabled, nested KVM would not see a difference. > + vmx_set_rflags(vcpu, 0x02); There's a macro X86_EFLAGS_BIT1 which you can use for this 0x02. -- Nadav Har'El | Sunday, Mar 3 2013, 22 Adar 5773 nyh@math.technion.ac.il |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |"I don't use drugs, my dreams are http://nadav.harel.org.il |frightening enough." -- M. C. Escher