diff --git a/bochs/cpu/paging.cc b/bochs/cpu/paging.cc index 90693aa7a..dcfc451f1 100644 --- a/bochs/cpu/paging.cc +++ b/bochs/cpu/paging.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: paging.cc,v 1.203 2010-04-01 20:06:09 sshwarts Exp $ +// $Id: paging.cc,v 1.204 2010-04-01 20:08:57 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2010 The Bochs Project @@ -1101,9 +1101,6 @@ bx_phy_address BX_CPU_C::translate_linear(bx_address laddr, unsigned curr_pl, un } } - // Calculate physical memory address and fill in TLB cache entry - paddress = ppf | poffset; - #if BX_CPU_LEVEL >= 5 if (lpf_mask > 0xfff) BX_CPU_THIS_PTR TLB.split_large = 1; @@ -1111,10 +1108,12 @@ bx_phy_address BX_CPU_C::translate_linear(bx_address laddr, unsigned curr_pl, un } else { // no paging - ppf = lpf; - paddress = lpf | poffset; + ppf = (bx_phy_address) lpf; } + // Calculate physical memory address and fill in TLB cache entry + paddress = ppf | poffset; + // direct memory access is NOT allowed by default tlbEntry->lpf = lpf | TLB_HostPtr; tlbEntry->lpf_mask = ~((bx_address) lpf_mask); @@ -1188,11 +1187,7 @@ bx_bool BX_CPU_C::dbg_xlate_linear2phy(bx_address laddr, bx_phy_address *phy) #if BX_CPU_LEVEL >= 6 if (BX_CPU_THIS_PTR cr4.get_PAE()) { - int levels = 3; -#if BX_SUPPORT_X86_64 - if (long_mode()) - levels = 4; -#endif + int levels = 3 + long_mode(); for (int level = levels - 1; level >= 0; --level) { Bit64u pte; pt_address += 8 * ((laddr >> (12 + 9*level)) & 511); diff --git a/bochs/cpu/vmx.h b/bochs/cpu/vmx.h index 6b89837f8..b23340d0a 100755 --- a/bochs/cpu/vmx.h +++ b/bochs/cpu/vmx.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: vmx.h,v 1.20 2010-04-01 11:43:45 sshwarts Exp $ +// $Id: vmx.h,v 1.21 2010-04-01 20:08:57 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2009 Stanislav Shwartsman @@ -575,7 +575,7 @@ typedef struct bx_VMCS #ifdef BX_VMX_ENABLE_ALL -#define VMX_VM_EXEC_CTRL3_SUPPORTED_BITS (0x0000004f) +#define VMX_VM_EXEC_CTRL3_SUPPORTED_BITS (0x000004ff) #else // only really supported features