diff options
author | ionescu007 <aionescu+git@gmail.com> | 2016-08-29 09:20:28 +0300 |
---|---|---|
committer | ionescu007 <aionescu+git@gmail.com> | 2016-08-29 09:20:28 +0300 |
commit | aef226a992149007c513e8bbcb4dc2e7b73cc7b9 (patch) | |
tree | c2edd9f712deb67e55dbbc90a2bcfc232639c475 | |
parent | 34472d9045d16280c9a4502ac83b383d75b7f740 (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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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. |