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
AgeCommit message (Collapse)Author
2018-12-09Added parens to match code styleHEADmasterMichael
2018-12-09Fixed off-by-one edge case in memory type assignmentMichael
2018-08-13Merge pull request #32 from wbenny/masterAlex Ionescu
Remove VM_EXIT_ACK_INTR_ON_EXIT flag and fix BSOD
2018-08-05Fix BSOD on shutdown when DriverEntry failsPetr Benes
The registered power callback needs to be unregistered when ShvLoad happens to fail, as DriverUnload is not called when DriverEntry does not succeed. Code before patch allowed to create a situation, where ShvLoad in DriverEntry failed, which resulted in the leak of PowerCallback, which - on machine shutdown/reboot - resulted in critical pagefault in the area of the unloaded driver and the system went blue.
2018-08-03Remove unnecessary VM_EXIT_ACK_INTR_ON_EXIT flagParallel Xenoexcite
Setting VM_EXIT_ACK_INTR_ON_EXIT makes sense only when PIN_BASED_EXT_INTR is set (see Intel Manual Vol3C[24.7.1(VM-Exit Controls)]).
2018-01-04Update README.mdAlex Ionescu
2017-12-12Merge pull request #24 from tandasat/support-invpcidAlex Ionescu
Fix bugcheck on Windows 10 RS4
2017-12-12Merge pull request #25 from tandasat/fix-warnings-and-typoAlex Ionescu
Fix code analysis warnings and typo
2017-11-26Fix code analysis warnings and typoSatoshi Tanda
This change fixes warnings seen with code analysis on VS2017 and typo. Also, excludes a .VC.db file.
2017-11-26Fix bugcheck on Windows 10 RS4Satoshi Tanda
Windows 10 RS4 uses the invpcid instruction. This instruction is disabled by the hypervisor, and execution of it causes #UD, which triggers bugcheck. This change is to allow the kernel to execute the instruction.
2017-11-07Fix UEFI issues -- SimpleVisor now works on UEFI MP systems.Alex Ionescu
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.
2017-11-06Fix Issue #20Alex Ionescu
Use EFI_SIZE_TO_PAGES to fix issue #20
2017-11-06Properly support building for UEFI vs NT with VisualUefiAlex Ionescu
Refactor all project files/settings to support dual build. User should set EDK_PATH to their checked out copy of VisualUefi.
2017-03-25Add power-state callback to handle sleep/hibernate/resume correctly.Alex Ionescu
The hypervisor unloads on S0->Sx transitions, and loads back on Sx->S0 transitions.
2017-03-25Fix bug on unload when no hypervisor loaded. CPUID still returns valid data ↵Alex Ionescu
when leaf is invalid! To address this, return a magic value in RCX so we can be sure that RAX:RBX are trustworthy and contain VP_DATA.
2017-03-25Use 2MB pages. It's only a few more lines of code and avoids the perf costs ↵Alex Ionescu
of 1GB UC regions. Also has the benefit of allowing this to run on VMWare systems now.
2017-03-20Re-enable EPT support, with correct parsing of MTRR registers to respect ↵Alex Ionescu
caching properties.
2017-03-20Update EPT structure definitions and add MTRR structure definitions.Alex Ionescu
2017-03-20Fix ShvOsDebugPrint (at least on Windows).Alex Ionescu
2017-03-15Final RS2 Fix and Disable EPTs -- WHEA errors on some systems.Alex Ionescu
2017-03-15Cleanup sourceAlex Ionescu
2017-03-15WIP: Redstone 2 fixAlex Ionescu
2017-03-14EDK-II Build FileAlex Ionescu
Thanks to d_olex / Dmytro Oleksiuk
2016-10-30Merge pull request #15 from saaramar/patch-1Alex Ionescu
Fix memory leak in shvvp.c
2016-10-30Fix memory leak in ShvVpLoadCallbackSaar Amar
2016-10-27Fix memory leak in ShvVpLoadCallbackSaar Amar
2016-10-25Update shvvp.cSaar Amar
Fix memory leak in ShvVpLoadCallback. There is a flow (when ShvVpInitialize is failed) that the per-processor data is not freed before the goto Failure and return. Of-course, we can't free it in the Failure, since we need to distinguish between different flows of failures (fail to allocate, fail to initialize, hypervisor not present) So just keep freeing it anytime we fail for some reason (just as when our hypervisor is not present on line 275). Thanks :)
2016-10-20Merge pull request #13 from saaramar/patch-1Alex Ionescu
Update shvos.c
2016-10-20Update shvos.cSaar Amar
In ShvVpInitialize, there is a branch checking for SHV_STATUS_SUCCESS, added in one of the commits supporting UEFI (f5dd1af). If you want to share code between nt and uefi, the nt version of ShvOsPrepareProcessor should return SHV_STATUS_SUCCESS in default flow :)
2016-10-15Update README.mdAlex Ionescu
2016-10-15Update README.mdAlex Ionescu
2016-09-03Officially add support for UEFI: Uefisor!ionescu007
Documentation to follow.
2016-09-03Last fixes. Now builds/works in UEFI with a shared code base.ionescu007
2016-09-03Invert files... idiot.ionescu007
2016-09-03Reflect this is non-portable.ionescu007
2016-09-03Final factoring -- separate portable from non-portable ASM code.ionescu007
2016-09-03Support VMWARE/non-EPT sytems. More portability support with non-NT systems. ↵ionescu007
Refactoring. Reject NULL/LDT selectors when building VMCS. Support systems without 1GB HugePage EPT support (such as Vmware) by simply not enabling EPT for the. Refactor header files and some definitions again to support non-NT. Deallocation routines on some platform need to have a size. Refactor alloc and free so this is easy to maintain portably. Make ShvVmxLaunchOnVpreturn a status code instead of VOID, so we can actually know if launch failed instead of just relying on CPUID (which, if the hypervisor was already loaded, misidentified that a second load failed, and instead assumed success). Refactor the launch/off-on-failure code into a ShvVmxLaunch routine. Fix some comments to reflect the new portability layer/refactoring. Factor out OS-specific load/unload logic (ShvOsPrepareProcessor/ShvOsUnprepareProcessor) Fix ShvUtilConvertGdtEntry to reject selectors with the TI bit set, or NULL selectors, and correctly mark them as unusable.
2016-08-30More portability.ionescu007
Fix the last few stragglers.
2016-08-30Fix sign extension bug.ionescu007
2016-08-30Fix bug not correctly translating success back.ionescu007
2016-08-30A few more OS layer separations. Fix unload bug when SimpleVisor is not present.ionescu007
If SimpleVisor got unloaded, __cpuidex might not return valid data in EAX:EBX. Handle this case.
2016-08-29Move to what should be much more portable types. Fix straggler NT-specific APIs.ionescu007
SimpleVisor no longer builds with NT headers -- instead, ntint.h provides the necessary NT"isms" and compiler definitions. Create a bridge header (shv_x.h) between the OS layer and SimpleVisor layer. ShvOs.c builds with the NT Headers, and don't use ntint.h, importing only shv_x.h
2016-08-29Separate Hypervisor Core from OS Layer. Don't touch IRQL in Hypervisor. ↵ionescu007
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.
2016-08-29Remove debug printionescu007
2016-08-29When unloading the hypervisor on each core, returnt he VP Data structureionescu007
This allows us to now free the data for each processor, by returning its pointer through the CPUID interface.
2016-08-29Fix bug which was causing us to return with hypervisor's RFLAGSionescu007
This led to interrupts being disabled inside of ShvVpUninitialize, which is why when calling MmFreeContigousMemory, we were sometimes getting hangs, if a TLB flush had to be performed (IPI would not be delivered). Correct restore RFLAGS back to correct guest state.
2016-08-29Death to global data!ionescu007
Each routine knew exactly how to get its VP Data except the post-launch-guest-resumer. We now run it on the hypervisor stack (which shouldn't matter -- because it uses no stack variables other than the home space), which means it can essentially "containing record" its VP data based on it.
2016-08-29Uee nice define.ionescu007
2016-08-29Continue WIP VP data cleanup.ionescu007
We no longer need the VmxEnabled flag and confusing logic around it.
2016-08-29WIP Cleaner way to launch.ionescu007