lkml.org 
[lkml]   [2018]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH RFC v2 3/5] KVM: nVMX: add enlightened VMCS state
Date
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

\
 
 \ /
  Last update: 2018-05-15 13:12    [W:0.070 / U:8.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site