small fixes

This commit is contained in:
Stanislav Shwartsman 2010-04-01 20:08:57 +00:00
parent 585cc3492b
commit a625abaaf0
2 changed files with 8 additions and 13 deletions

View File

@ -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);

View File

@ -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