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:
authorionescu007 <aionescu+git@gmail.com>2016-08-29 20:49:52 +0300
committerionescu007 <aionescu+git@gmail.com>2016-08-29 20:49:52 +0300
commitf35f5b35bf3dfda2b65b92ccf47a2e7953351563 (patch)
treec3d86202061df9b017f7338f5d5c20cc313d5cb6 /shvvmx.c
parentdd64f6a1cdc6d7a396d0e9c9fd2f875685effb37 (diff)
Separate Hypervisor Core from OS Layer. Don't touch IRQL in Hypervisor. Separate Load vs Unload callback. Misc. portability fixes.
Create a layer of OS-specific functions to handle the various requirements around memory allocation, context save/restore, entrypoint/unloadpoint, and multi-CPU execution and topology information. SimpleVisor no longer uses NT-specific functions (some structures and types still remain). Additionally, the hypervisor should not know that "NT" is running underneath, so it has no business touching the IRQL. As we won't call Windows functions, and as interrupts are disabled, this doesn't 'change' anything and is correct. Don't use the same callback for load and unload. We can make unload its own callback now, as we've separated out the DPC-specific logic. This makes the load callback cleaner as well. Remove NT_ASSERTS which don't work anyway, and use portable definitions/types when possible (more to do here). Return the failed CPU and status in all cases during load. Sometimes this wasn't done before.
Diffstat (limited to 'shvvmx.c')
-rw-r--r--shvvmx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shvvmx.c b/shvvmx.c
index 0fb4338..eb080ff 100644
--- a/shvvmx.c
+++ b/shvvmx.c
@@ -445,7 +445,7 @@ ShvVmxLaunchOnVp (
//
// Initialize all the VMX-related MSRs by reading their value
//
- for (i = 0; i < RTL_NUMBER_OF(VpData->MsrData); i++)
+ for (i = 0; i < sizeof(VpData->MsrData) / sizeof(VpData->MsrData[0]); i++)
{
VpData->MsrData[i].QuadPart = __readmsr(MSR_IA32_VMX_BASIC + i);
}