Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ionescu007/SimpleVisor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ionescu <ionescu007@users.noreply.github.com>2018-08-13 17:00:50 +0300
committerGitHub <noreply@github.com>2018-08-13 17:00:50 +0300
commit0275e1e184bcf16314fcf789ddb16f0539440ec3 (patch)
treee62dc7ec35a5eccc87aeef4ccf6a9c60a652b8c1
parent0ed192a566df15476f329b6adc4d638e65d4ea5c (diff)
parent3581425b5bed4905db4460cd3ee1f4897d0d5cad (diff)
Merge pull request #32 from wbenny/master
Remove VM_EXIT_ACK_INTR_ON_EXIT flag and fix BSOD
-rw-r--r--nt/shvos.c13
-rw-r--r--shvvmx.c4
2 files changed, 13 insertions, 4 deletions
diff --git a/nt/shvos.c b/nt/shvos.c
index 532fcf0..4017525 100644
--- a/nt/shvos.c
+++ b/nt/shvos.c
@@ -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;
}
diff --git a/shvvmx.c b/shvvmx.c
index 06d5303..d7e9958 100644
--- a/shvvmx.c
+++ b/shvvmx.c
@@ -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));
//