From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 18/24] Exiting from L2 to L1 Date: Mon, 13 Sep 2010 10:52:00 +0200 Message-ID: <4C8DE630.9010405@redhat.com> References: <1276431753-nyh@il.ibm.com> <20100912170503.GA7828@fermat.math.technion.ac.il> <4C8D0C19.4050003@redhat.com> <201009131353.56814.sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "Nadav Har'El" , kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48686 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754420Ab0IMIwG (ORCPT ); Mon, 13 Sep 2010 04:52:06 -0400 In-Reply-To: <201009131353.56814.sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On 09/13/2010 07:53 AM, Sheng Yang wrote: >> >>>> What can happen is that the contents of the field is transferred t= o the >>>> IDT_VECTORING_INFO field or VM_EXIT_INTR_INFO field. >>>> >>>> (question: on a failed vmentry, is this field cleared?) >>> I don't know the answer :-) >> Sheng? > According to SDM 23.7 "VM-ENTRY FAILURES DURING OR AFTER LOADING > GUEST STATE": > > Although this process resembles that of a VM exit, many steps taken d= uring a VM > exit do not occur for these VM-entry failures: > =E2=80=A2 Most VM-exit information fields are not updated (see step 1= above). > =E2=80=A2 The valid bit in the VM-entry interruption-information fiel= d is *not* cleared. > =E2=80=A2 The guest-state area is not modified. > =E2=80=A2 No MSRs are saved into the VM-exit MSR-store area. > > So VM entry failure would result in _keep_ valid bit of VM_ENTRY_INTR= _INFO_FIELD. > > Ok. So if the exit was actually due to a failed vmentry, then we do=20 need the vmread... (or alternatively, we can avoid clearing the field i= n=20 the first place). So the following options should work: 1. vmcs12->vm_entry_intr_info_field =3D=20 vmcs_read32(VM_ENTRY_INTR_INFO_FIELD); 2. if (!(exit_reason & FAILED_ENTRY)) vmcs12->vm_exit_intry_info_field= =20 &=3D ~VALID; 3. if (exit_reason & FAILED_ENTRY) vmcs12->vm_entry_intr_info_field =3D= =20 vmcs_read32(VM_ENTRY_INTR_INFO_FIELD); --=20 error compiling committee.c: too many arguments to function