All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, "Radim Krčmář" <rkrcmar@redhat.com>,
	"Roman Kagan" <rkagan@virtuozzo.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	"Haiyang Zhang" <haiyangz@microsoft.com>,
	"Stephen Hemminger" <sthemmin@microsoft.com>,
	"Michael Kelley (EOSG)" <Michael.H.Kelley@microsoft.com>,
	"Mohammed Gamal" <mmorsy@redhat.com>,
	"Cathy Avery" <cavery@redhat.com>,
	linux-kernel@vger.kernel.org, "Jim Mattson" <jmattson@google.com>
Subject: Re: [PATCH RFC v2 3/5] KVM: nVMX: add enlightened VMCS state
Date: Tue, 15 May 2018 13:11:13 +0200	[thread overview]
Message-ID: <87zi11jhri.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <a4277986-1633-c39c-43a6-b056ae489230@redhat.com> (Paolo Bonzini's message of "Mon, 14 May 2018 18:22:29 +0200")

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 11/05/2018 15:37, Vitaly Kuznetsov wrote:
>> -	if (enable_shadow_vmcs)
>> -		to_vmx(vcpu)->nested.sync_shadow_vmcs = true;
>> +
>> +	if (vmx->nested.hv_evmcs)
>> +		vmx->nested.sync_enlightened_vmcs = true;
>> +	else if (enable_shadow_vmcs)
>> +		vmx->nested.sync_shadow_vmcs = true;
>>  }
>
> These four lines are a bit repeated.  Perhaps change them to
>
> 	if (enable_shadow_vmcs || vmx->nested.hv_evmcs)
> 		vmx->nested.need_vmcs12_sync = true;
>
> and elsewhere
>
> 	if (vmx->nested.need_vmcs12_sync) {
> 	       if (vmx->nested.hv_evmcs) {
> 	               copy_vmcs12_to_enlightened(vmx);
> 	               /* All fields are clean */
> 	               vmx->nested.hv_evmcs->hv_clean_fields |=
> 				HV_VMX_ENLIGHTENED_CLEAN_FIELD_ALL;
> 			vmx->nested.sync_enlightened_vmcs = false;
> 		} else {
> 	                copy_vmcs12_to_shadow(vmx);
> 		}
> 		vmx->nested.need_vmcs12_sync = false;
> 	}
>
> ?

True, we always know which VMCS we currently use so we can use a single
flag. Will do, thanks!

-- 
  Vitaly

  reply	other threads:[~2018-05-15 11:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11 13:37 [PATCH RFC v2 0/5] KVM: nVMX: Enlightened VMCS for Hyper-V on KVM Vitaly Kuznetsov
2018-05-11 13:37 ` [PATCH RFC v2 1/5] KVM: hyperv: define VP assist page helpers Vitaly Kuznetsov
2018-05-11 13:37 ` [PATCH RFC v2 2/5] KVM: nVMX: add KVM_CAP_HYPERV_ENLIGHTENED_VMCS capability Vitaly Kuznetsov
2018-05-11 13:37 ` [PATCH RFC v2 3/5] KVM: nVMX: add enlightened VMCS state Vitaly Kuznetsov
2018-05-14 16:22   ` Paolo Bonzini
2018-05-15 11:11     ` Vitaly Kuznetsov [this message]
2018-05-11 13:37 ` [PATCH RFC v2 4/5] KVM: nVMX: implement enlightened VMPTRLD and VMCLEAR Vitaly Kuznetsov
2018-05-11 13:37 ` [PATCH RFC v2 5/5] KVM: nVMX: optimize prepare_vmcs02{,_full} for Enlightened VMCS case Vitaly Kuznetsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zi11jhri.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=Michael.H.Kelley@microsoft.com \
    --cc=cavery@redhat.com \
    --cc=haiyangz@microsoft.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmorsy@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkagan@virtuozzo.com \
    --cc=rkrcmar@redhat.com \
    --cc=sthemmin@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.