From bd82bdb561c552d2fe45d6b84b7aec44694c314c Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sat, 2 Apr 2022 16:05:04 +0200 Subject: [PATCH] Fix hypervisor --- src/driver/assembly2.asm | 9 +++------ src/driver/hypervisor.cpp | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/driver/assembly2.asm b/src/driver/assembly2.asm index ab22317..a5550a9 100644 --- a/src/driver/assembly2.asm +++ b/src/driver/assembly2.asm @@ -31,12 +31,9 @@ include ksamd64.inc push rcx ; save the RCX register, which we spill below lea rcx, [rsp+8h] ; store the context in the stack, bias for ; the return address and the push we just did. - call ShvOsCaptureContext ; save the current register state. - ; note that this is a specially written function - ; which has the following key characteristics: - ; 1) it does not taint the value of RCX - ; 2) it does not spill any registers, nor - ; expect home space to be allocated for it + sub rsp, 30h + call ShvOsCaptureContext + add rsp, 30h mov rcx, [rsp+CxRsp+8h] add rcx, 8h mov [rsp+CxRsp+8h], rcx diff --git a/src/driver/hypervisor.cpp b/src/driver/hypervisor.cpp index ec2b86e..cb59a7e 100644 --- a/src/driver/hypervisor.cpp +++ b/src/driver/hypervisor.cpp @@ -318,7 +318,7 @@ void ShvVmxEptInitialize(vmx::vm_state* VpData) // // Loop every 1GB of RAM (described by the PDPTE) // - __stosq((UINT64*)VpData->epdpt, tempEpde.full, PDPTE_ENTRY_COUNT * PDE_ENTRY_COUNT); + __stosq((UINT64*)VpData->epde, tempEpde.full, PDPTE_ENTRY_COUNT * PDE_ENTRY_COUNT); for (i = 0; i < PDPTE_ENTRY_COUNT; i++) { //