Re: [PATCH v3 3/3] KVM: nVMX: Fix mmu context after VMLAUNCH/VMRESUME failure

From: Paolo Bonzini
Date: Thu Nov 02 2017 - 13:54:47 EST


On 02/11/2017 09:31, Wanpeng Li wrote:
> +
> + nested_ept_uninit_mmu_context(vcpu);
> +
> + /*
> + * Only PDPTE load can fail as the value of cr3 was checked on entry and
> + * couldn't have changed.
> + */
> + if (nested_vmx_load_cr3(vcpu, vmcs12->host_cr3, false, &entry_failure_code))
> + nested_vmx_abort(vcpu, VMX_ABORT_LOAD_HOST_PDPTE_FAIL);
> +
> + if (!enable_ept)
> + vcpu->arch.walk_mmu->inject_page_fault = kvm_inject_page_fault;
> +

This code is duplicated from load_vmcs12_host_state. Therefore, please
move it to a new function load_vmcs12_mmu_host_state.

Thanks,

Paolo