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-09-03 19:05:42 +0300
committerionescu007 <aionescu+git@gmail.com>2016-09-03 19:05:42 +0300
commitf5dd1af02f22e2caf564dea4705bce2d42167061 (patch)
tree0ed56e8c5919731fb3dfa70b6d7a922bbcfb4995
parentdfd4909816fc06841cffc86d1c2170e5cd68bfbd (diff)
Last fixes. Now builds/works in UEFI with a shared code base.
-rw-r--r--ntint.h2
-rw-r--r--shv.h2
-rw-r--r--shv.vcxproj2
-rw-r--r--shvvmx.c8
-rw-r--r--shvvp.c12
5 files changed, 17 insertions, 9 deletions
diff --git a/ntint.h b/ntint.h
index fdeb3b2..9fcb1d7 100644
--- a/ntint.h
+++ b/ntint.h
@@ -21,6 +21,8 @@ Environment:
--*/
#pragma once
+#pragma warning(disable:4201)
+#pragma warning(disable:4214)
#define VOID void
#define DECLSPEC_ALIGN(x) __declspec(align(x))
diff --git a/shv.h b/shv.h
index 5760026..452c116 100644
--- a/shv.h
+++ b/shv.h
@@ -128,7 +128,7 @@ ShvOsUnprepareProcessor (
_In_ PSHV_VP_DATA VpData
);
-VOID
+INT32
ShvOsPrepareProcessor (
_In_ PSHV_VP_DATA VpData
);
diff --git a/shv.vcxproj b/shv.vcxproj
index 98bf27a..fd0e09c 100644
--- a/shv.vcxproj
+++ b/shv.vcxproj
@@ -70,7 +70,7 @@
</ItemGroup>
<ItemGroup>
<MASM Include="shvvmxhvx64.asm" />
- <MASM Include="shvx64.asm" />
+ <MASM Include="shvosx64.asm" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/shvvmx.c b/shvvmx.c
index f3f388b..f4f39b9 100644
--- a/shvvmx.c
+++ b/shvvmx.c
@@ -251,7 +251,7 @@ ShvVmxSetupVmcsForVp (
__vmx_vmwrite(VM_ENTRY_CONTROLS,
ShvUtilAdjustMsr(VpData->MsrData[16],
VM_ENTRY_IA32E_MODE));
-
+
//
// Load the CS Segment (Ring 0 Code)
//
@@ -291,7 +291,7 @@ ShvVmxSetupVmcsForVp (
__vmx_vmwrite(GUEST_ES_AR_BYTES, vmxGdtEntry.AccessRights);
__vmx_vmwrite(GUEST_ES_BASE, vmxGdtEntry.Base);
__vmx_vmwrite(HOST_ES_SELECTOR, context->SegEs & ~RPL_MASK);
-
+
//
// Load the FS Segment (Ring 3 Compatibility-Mode TEB)
//
@@ -302,7 +302,7 @@ ShvVmxSetupVmcsForVp (
__vmx_vmwrite(GUEST_FS_BASE, vmxGdtEntry.Base);
__vmx_vmwrite(HOST_FS_BASE, vmxGdtEntry.Base);
__vmx_vmwrite(HOST_FS_SELECTOR, context->SegFs & ~RPL_MASK);
-
+
//
// Load the GS Segment (Ring 3 Data if in Compatibility-Mode, MSR-based in Long Mode)
//
@@ -324,7 +324,7 @@ ShvVmxSetupVmcsForVp (
__vmx_vmwrite(GUEST_TR_BASE, vmxGdtEntry.Base);
__vmx_vmwrite(HOST_TR_BASE, vmxGdtEntry.Base);
__vmx_vmwrite(HOST_TR_SELECTOR, state->Tr & ~RPL_MASK);
-
+
//
// Load the Local Descriptor Table (Ring 0 LDT on Redstone)
//
diff --git a/shvvp.c b/shvvp.c
index 8c0a100..1b34069 100644
--- a/shvvp.c
+++ b/shvvp.c
@@ -114,10 +114,16 @@ ShvVpInitialize (
_In_ PSHV_VP_DATA Data
)
{
+ INT32 status;
+
//
// Prepare any OS-specific CPU data
//
- ShvOsPrepareProcessor(Data);
+ status = ShvOsPrepareProcessor(Data);
+ if (status != SHV_STATUS_SUCCESS)
+ {
+ return status;
+ }
// Read the special control registers for this processor
// Note: KeSaveStateForHibernate(&Data->HostState) can be used as a Windows
@@ -140,11 +146,11 @@ ShvVpInitialize (
// If the AC bit is not set in EFLAGS, it means that we have not yet
// launched the VM. Attempt to initialize VMX on this processor.
//
- return ShvVmxLaunchOnVp(Data);
+ status = ShvVmxLaunchOnVp(Data);
}
//
- // IF we got here, the hypervisor is running :-)
+ // If we got here, the hypervisor is running :-)
//
return SHV_STATUS_SUCCESS;
}