I think this problem appeared in inline _IntelRestoreCPU _ function when _StartHV _ fail.
because if StartHV fail but the StopHV have to run, but vmx is not start.
should change Vcpu->VmxState to VMX_STATE_OFF when __vmx_vmlaunch fail in VmxSubvertCPU.
so I add the code in VmxSubvertCPU like this:
// Setup various VMCS fields by VmxSetupVmcs. This will cause the
// processor to jump to the return address of RtlCaptureContext in
// VmxInitializeCPU, which called us.
InterlockedIncrement( &g_Data->vcpus );
int res = __vmx_vmlaunch();
InterlockedDecrement( &g_Data->vcpus );
//if launch fail,set state to off.
Vcpu->VmxState = VMX_STATE_OFF;
hi.
when I Run in VMware will be fail and BSOD.
I think this problem appeared in inline _IntelRestoreCPU _ function when _StartHV _ fail.
because if StartHV fail but the StopHV have to run, but vmx is not start.
should change Vcpu->VmxState to VMX_STATE_OFF when __vmx_vmlaunch fail in VmxSubvertCPU.
so I add the code in VmxSubvertCPU like this:
StartHV in VMware will be fail but have not BSOD.