From edfff5bf4424f0c35db585bc8ddfda67d936fd8b Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Fri, 6 Jan 2012 10:30:07 +0000 Subject: [PATCH] fixed VMX+EPT VirtualBox failures --- bochs/cpu/paging.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bochs/cpu/paging.cc b/bochs/cpu/paging.cc index 7dc66e979..e1a0ea936 100644 --- a/bochs/cpu/paging.cc +++ b/bochs/cpu/paging.cc @@ -1164,17 +1164,18 @@ bx_phy_address BX_CPU_C::translate_linear(bx_address laddr, unsigned user, unsig ppf = (bx_phy_address) lpf; } + // Calculate physical memory address and fill in TLB cache entry + paddress = A20ADDR(ppf | poffset); + #if BX_SUPPORT_VMX >= 2 if (BX_CPU_THIS_PTR in_vmx_guest) { if (SECONDARY_VMEXEC_CONTROL(VMX_VM_EXEC_CTRL3_EPT_ENABLE)) { - ppf = translate_guest_physical(ppf, laddr, 1, 0, rw); + paddress = translate_guest_physical(paddress, laddr, 1, 0, rw); + ppf = PPFOf(paddress); } } #endif - // Calculate physical memory address and fill in TLB cache entry - paddress = A20ADDR(ppf | poffset); - // direct memory access is NOT allowed by default tlbEntry->lpf = lpf | TLB_HostPtr; tlbEntry->lpf_mask = lpf_mask;