From: Paolo Bonzini Subject: Re: [PATCH v2 6/6] KVM: nVMX: optimize prepare_vmcs02{,_full} for Enlightened VMCS case Date: Tue, 24 Jul 2018 19:09:04 +0200 Message-ID: References: <20180621123046.29606-1-vkuznets@redhat.com> <20180621123046.29606-7-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Roman Kagan , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , linux-kernel@vger.kernel.org, Jim Mattson , Liran Alon To: Vitaly Kuznetsov , kvm@vger.kernel.org Return-path: In-Reply-To: <20180621123046.29606-7-vkuznets@redhat.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 21/06/2018 14:30, Vitaly Kuznetsov wrote: > +static __always_inline bool evmcs_needs_write(struct vcpu_vmx *vmx, > + u16 clean_field) > +{ > + if (vmx->nested.dirty_vmcs12) > + return true; Why is this needed? If it weren't for it, you could pass hv_evmcs directly to evmcs_needs_write, which would simplify the code a bit in the caller. Paolo > + return !(vmx->nested.hv_evmcs->hv_clean_fields & clean_field);