From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tian, Kevin" Subject: RE: [PATCH 21/31] nVMX: vmcs12 checks on nested entry Date: Wed, 25 May 2011 15:33:48 +0800 Message-ID: <625BA99ED14B2D499DC4E29D8138F1505C9BFA399D@shsmsx502.ccr.corp.intel.com> References: <1305575004-nyh@il.ibm.com> <201105161954.p4GJseNX001963@rice.haifa.ibm.com> <625BA99ED14B2D499DC4E29D8138F1505C9BFA377E@shsmsx502.ccr.corp.intel.com> <20110525053801.GA7207@fermat.math.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Cc: "kvm@vger.kernel.org" , "gleb@redhat.com" , "avi@redhat.com" To: Nadav Har'El Return-path: Received: from mga11.intel.com ([192.55.52.93]:6163 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755019Ab1EYHec convert rfc822-to-8bit (ORCPT ); Wed, 25 May 2011 03:34:32 -0400 In-Reply-To: <20110525053801.GA7207@fermat.math.technion.ac.il> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: > From: Nadav Har'El [mailto:nyh@math.technion.ac.il] > Sent: Wednesday, May 25, 2011 1:38 PM > > On Wed, May 25, 2011, Tian, Kevin wrote about "RE: [PATCH 21/31] nVMX: > vmcs12 checks on nested entry": > > > + if (vmcs12->launch_state == launch) { > > > + nested_vmx_failValid(vcpu, > > > + launch ? VMXERR_VMLAUNCH_NONCLEAR_VMCS > > > + : VMXERR_VMRESUME_NONLAUNCHED_VMCS); > > > + return 1; > > > + } > > > > from SDM: > > ELSIF (VMLAUNCH and launch state of current VMCS is not "clear") > > THEN VMfailValid(VMLAUNCH with non-clear VMCS); > > ELSIF (VMRESUME and launch state of current VMCS is not "launched") > > THEN VMfailValid(VMRESUME with non-launched VMCS); > > > > So it's legal to use VMLAUNCH on a launched VMCS. However here you > > changes this behavior. On the other hand, do you want to add a 'clear' state > > along with L1 VMCLEAR to catch the failure here? > > I don't understand: I always understood the spec to mean that "clear" and > "launched" the two opposite states of the "launch state" bit? If it isn't, > what does "clear" mean? > > Is it really "legal to use a VMLAUNCH on a launched VMCS"? > If it is, why does KVM, for example, go to great lengths to VMLAUNCH the > first time, and VMRESUME all subsequent times? > You're correct. I've got my head messed on this point. :-) Thanks Kevin