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 09:20:28 +0300
committerionescu007 <aionescu+git@gmail.com>2016-08-29 09:20:28 +0300
commitaef226a992149007c513e8bbcb4dc2e7b73cc7b9 (patch)
treec2edd9f712deb67e55dbbc90a2bcfc232639c475
parent34472d9045d16280c9a4502ac83b383d75b7f740 (diff)
Fix bug which was causing us to return with hypervisor's RFLAGS
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.
-rw-r--r--shvvmxhv.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/shvvmxhv.c b/shvvmxhv.c
index 68a1fbd..886ad0d 100644
--- a/shvvmxhv.c
+++ b/shvvmxhv.c
@@ -284,12 +284,14 @@ ShvVmxEntryHandler (
__writecr3(ShvVmxRead(GUEST_CR3));
//
- // Finally, set the stack and instruction pointer to whatever location
- // had the instruction causing our VM-Exit, such as ShvVpUninitialize.
- // This will effectively act as a longjmp back to that location.
+ // Finally, restore the stack, instruction pointer and EFLAGS to the
+ // original values present when the instruction causing our VM-Exit
+ // execute (such as ShvVpUninitialize). This will effectively act as
+ // a longjmp back to that location.
//
Context->Rsp = guestContext.GuestRsp;
Context->Rip = (ULONG64)guestContext.GuestRip;
+ Context->EFlags = (ULONG)guestContext.GuestEFlags;
//
// Turn off VMX root mode on this logical processor. We're done here.