From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 09/10] KVM: nVMX: Synchronize VMCS12 content with the shadow vmcs Date: Wed, 17 Apr 2013 18:39:01 +0300 Message-ID: <20130417153901.GC8997@redhat.com> References: <1366199437-abelg@il.ibm.com> <20130417115510.ED10F7B802A@moren.haifa.ibm.com> <20130417143449.GK1682@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dongxiao.xu@intel.com, jun.nakajima@intel.com, kvm@vger.kernel.org, nadav@harel.org.il, owasserm@redhat.com To: Abel Gordon Return-path: Received: from mx1.redhat.com ([209.132.183.28]:15501 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755790Ab3DQPje (ORCPT ); Wed, 17 Apr 2013 11:39:34 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Apr 17, 2013 at 05:59:50PM +0300, Abel Gordon wrote: > > > Gleb Natapov wrote on 17/04/2013 05:34:49 PM: > > > > @@ -5716,6 +5725,10 @@ static void nested_vmx_failValid(struct > > > X86_EFLAGS_SF | X86_EFLAGS_OF)) > > > | X86_EFLAGS_ZF); > > > get_vmcs12(vcpu)->vm_instruction_error = vm_instruction_error; > > > + /* > > > + * We don't need to force a shadow sync because > > > + * VM_INSTRUCTION_ERROR is not shdowed > > ---------------------------------------^ shadowed. > > But lets just request sync. This is slow path anyway. > > Why then ? Because we do not care how fast the error case is handled, so no point breaking the rules for it. > Note this will require to call copy_shadow_to_vmcs12 > because nested_vmx_failValid can be called while L0 handles a L1 > exit (for vmx instruction emulation) and the shadow vmcs could > have been modified by L1 before the exit. > Right, not a big deal if this is the only case when it happens. When we discussed accessors vs sync_shadow_vmcs flag approach I said that flag will work only if no vmcs12 fields are changed not as part of vmexit or vmwrite emulations. This one is such a field unfortunately. Hope it is the only one. -- Gleb.