Skip to content

Commit

Permalink
Merge pull request #32 from wbenny/master
Browse files Browse the repository at this point in the history
Remove VM_EXIT_ACK_INTR_ON_EXIT flag and fix BSOD
  • Loading branch information
ionescu007 authored Aug 13, 2018
2 parents 0ed192a + 3581425 commit 0275e1e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 12 additions & 1 deletion nt/shvos.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,17 @@ DriverEntry (
//
// Load the hypervisor
//
return ShvOsErrorToError(ShvLoad());
status = ShvOsErrorToError(ShvLoad());

//
// If load of the hypervisor happened to fail, unregister previously registered
// power callback, otherwise we would get BSOD on shutdown.
//
if (!NT_SUCCESS(status))
{
ExUnregisterCallback(g_PowerCallbackRegistration);
}

return status;
}

4 changes: 1 addition & 3 deletions shvvmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,10 @@ ShvVmxSetupVmcsForVp (
CPU_BASED_ACTIVATE_SECONDARY_CONTROLS));

//
// If any interrupts were pending upon entering the hypervisor, acknowledge
// them when we're done. And make sure to enter us in x64 mode at all times
// Make sure to enter us in x64 mode at all times.
//
__vmx_vmwrite(VM_EXIT_CONTROLS,
ShvUtilAdjustMsr(VpData->MsrData[15],
VM_EXIT_ACK_INTR_ON_EXIT |
VM_EXIT_IA32E_MODE));

//
Expand Down

0 comments on commit 0275e1e

Please sign in to comment.