Re[PATCH 3/6] KVM: nVMX: properly handle errors in nested_vmx_handle_enlightened_vmptrld()
linmiaohe
Reviewed-byHi:
Quoted 11 lines · Vitaly Kuznetsov
nested_vmx_handle_enlightened_vmptrld()fails in two cases:
- when we fail tokvm_vcpu_map()the supplied GPA
- whenrevision_idis incorrect.
Genuine Hyper-V raises #UD in the former case (at least with *some* incorrect GPAs) and doesVMfailInvalid()in the later. KVM doesn't do anything so L1 just gets stuck retrying the same faulty VMLAUNCH.
nested_vmx_handle_enlightened_vmptrld()has two call sites:nested_vmx_run()andnested_get_vmcs12_pages(). The former needs to queue do much: the failure there happens after migration when L2 was running (and L1 did something weird like wrote to VP assist page from a different vCPU), just kill L1 withKVM_EXIT_INTERNAL_ERROR.Reported-by Miaohe Lin <[email protected]>Signed-off-by Vitaly Kuznetsov <[email protected]>
Thanks for fixing this issue!:) The code looks fine for and it should works as far as I can say.