Re: [PATCH v2 6/6] KVM: nVMX: optimize prepare_vmcs02{,_full} for Enlightened VMCS case

From: Paolo Bonzini
Date: Tue Jul 24 2018 - 13:09:18 EST


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);