diff options
author | Alex Ionescu <ionescu007@users.noreply.github.com> | 2018-08-13 17:00:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-13 17:00:50 +0300 |
commit | 0275e1e184bcf16314fcf789ddb16f0539440ec3 (patch) | |
tree | e62dc7ec35a5eccc87aeef4ccf6a9c60a652b8c1 | |
parent | 0ed192a566df15476f329b6adc4d638e65d4ea5c (diff) | |
parent | 3581425b5bed4905db4460cd3ee1f4897d0d5cad (diff) |
Merge pull request #32 from wbenny/master
Remove VM_EXIT_ACK_INTR_ON_EXIT flag and fix BSOD
-rw-r--r-- | nt/shvos.c | 13 | ||||
-rw-r--r-- | shvvmx.c | 4 |
2 files changed, 13 insertions, 4 deletions
@@ -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; } @@ -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)); // |