diff options
author | Alex Ionescu <aionescu@gmail.com> | 2017-11-07 07:22:52 +0300 |
---|---|---|
committer | Alex Ionescu <aionescu@gmail.com> | 2017-11-07 07:22:52 +0300 |
commit | a2aafc35b86f8e17080f66d3137998359cfaea38 (patch) | |
tree | 6492abac19d102af5a67d091d2ba996eeb481185 /uefi | |
parent | 23f7da3a3cd78a54c51cb53a8246e8e553cac6c7 (diff) |
Fix UEFI issues -- SimpleVisor now works on UEFI MP systems.
1) On failures after vmxon, but before vmxlaunch, make sure to vmxoff.
2) On failure to initialize hypervisor, don't return SHV_STATUS_SUCCESS
ultimately. This was going to get caught later by the hypervisor CPUID
bit not being present, but this helps debugging.
3) Hypervisor should be an EFI driver (and runtime driver actually somee
day), not EFI application
4) Fix ShvOsFreeContiguousAlignedMemory to use pages, not bytes.
Diffstat (limited to 'uefi')
-rw-r--r-- | uefi/shvos.c | 7 | ||||
-rw-r--r-- | uefi/uefi.props | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/uefi/shvos.c b/uefi/shvos.c index 85a3713..57732bf 100644 --- a/uefi/shvos.c +++ b/uefi/shvos.c @@ -58,6 +58,11 @@ Environment: extern CONST UINT32 _gUefiDriverRevision = 0; // +// We support unload +// +const UINT8 _gDriverUnloadImageCount = 1; + +// // Our name // CHAR8 *gEfiCallerBaseName = "SimpleVisor"; @@ -257,7 +262,7 @@ ShvOsFreeContiguousAlignedMemory ( // // Free the memory // - FreeAlignedPages(BaseAddress, Size); + FreeAlignedPages(BaseAddress, EFI_SIZE_TO_PAGES(Size)); } VOID* diff --git a/uefi/uefi.props b/uefi/uefi.props index 2841656..065df75 100644 --- a/uefi/uefi.props +++ b/uefi/uefi.props @@ -31,9 +31,9 @@ </ClCompile> <Link> <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> - <AdditionalDependencies>UefiHiiLib.lib;UefiHiiServicesLib.lib;UefiSortLib.lib;UefiShellLib.lib;GlueLib.lib;BaseLib.lib;BaseDebugPrintErrorLevelLib.lib;BasePrintLib.lib;UefiLib.lib;UefiBootServicesTableLib.lib;UefiRuntimeServicesTableLib.lib;UefiDevicePathLibDevicePathProtocol.lib;UefiDebugLibConOut.lib;UefiMemoryLib.lib;UefiMemoryAllocationLib.lib;BaseSynchronizationLib.lib;UefiFileHandleLib.lib;UefiApplicationEntryPoint.lib</AdditionalDependencies> + <AdditionalDependencies>UefiHiiLib.lib;UefiHiiServicesLib.lib;UefiSortLib.lib;UefiShellLib.lib;GlueLib.lib;BaseLib.lib;BaseDebugPrintErrorLevelLib.lib;BasePrintLib.lib;UefiLib.lib;UefiBootServicesTableLib.lib;UefiRuntimeServicesTableLib.lib;UefiDevicePathLibDevicePathProtocol.lib;UefiDebugLibConOut.lib;UefiMemoryLib.lib;UefiMemoryAllocationLib.lib;BaseSynchronizationLib.lib;UefiFileHandleLib.lib;UefiDriverEntryPoint.lib</AdditionalDependencies> <GenerateDebugInformation>DebugFastLink</GenerateDebugInformation> - <SubSystem>EFI Application</SubSystem> + <SubSystem>EFI Boot Service Driver</SubSystem> <Driver>Driver</Driver> <OptimizeReferences>true</OptimizeReferences> <EnableCOMDATFolding /> |