Age | Commit message (Collapse) | Author |
|
|
|
|
|
Remove VM_EXIT_ACK_INTR_ON_EXIT flag and fix BSOD
|
|
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.
|
|
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)]).
|
|
|
|
Fix bugcheck on Windows 10 RS4
|
|
Fix code analysis warnings and typo
|
|
This change fixes warnings seen with code analysis on VS2017 and
typo. Also, excludes a .VC.db file.
|
|
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.
|
|
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.
|
|
Use EFI_SIZE_TO_PAGES to fix issue #20
|
|
Refactor all project files/settings to support dual build. User should
set EDK_PATH to their checked out copy of VisualUefi.
|
|
The hypervisor unloads on S0->Sx transitions, and loads back on Sx->S0
transitions.
|
|
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.
|
|
of 1GB UC regions.
Also has the benefit of allowing this to run on VMWare systems now.
|
|
caching properties.
|
|
|
|
|
|
|
|
|
|
|
|
Thanks to d_olex / Dmytro Oleksiuk
|
|
Fix memory leak in shvvp.c
|
|
|
|
|
|
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 :)
|
|
Update shvos.c
|
|
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 :)
|
|
|
|
|
|
Documentation to follow.
|
|
|
|
|
|
|
|
|
|
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.
|
|
Fix the last few stragglers.
|
|
|
|
|
|
If SimpleVisor got unloaded, __cpuidex might not return valid data in
EAX:EBX. Handle this case.
|
|
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
|
|
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.
|
|
|
|
This allows us to now free the data for each processor, by returning its
pointer through the CPUID interface.
|
|
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.
|
|
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.
|
|
|
|
We no longer need the VmxEnabled flag and confusing logic around it.
|
|
|