cpu to see up to 40 bit physical addr space

This commit is contained in:
Stanislav Shwartsman 2009-02-15 18:51:13 +00:00
parent bf92a5ea04
commit 6fb60de2b2
5 changed files with 104 additions and 37 deletions

View File

@ -7,6 +7,7 @@
--enable-apic \
--enable-x86-64 \
--enable-all-optimizations \
--enable-long-phy-address \
--enable-large-pages \
--enable-pae \
--enable-global-pages \

View File

@ -71,6 +71,9 @@ Detailed change log :
- I/O APIC
- implemented I/O APIC device hardware reset
- General
- Bochs param tree index keys are case independent now
- Misc
- Updated Bochs TESTFORM to version 0.4
@ -146,6 +149,7 @@ Detailed change log :
[1874124] bx_Instruction_c::ilen() const
- these S.F. feature requests were closed/implemented
[1977045] support 40 bit physical address
[1506385] Intel Core Duo VT features
[1429015] Support for user plugins
[1488136] debugger access to floppy controller

90
bochs/configure vendored
View File

@ -1550,6 +1550,7 @@ Optional Features:
--enable-plugins enable plugins
--enable-x86-64 compile in support for x86-64 instructions
--enable-smp compile in support for SMP configurations
--enable-long-phy-address compile in support for physical address larger than 32 bit
--enable-cpu-level select cpu level (3,4,5,6)
--enable-apic enable APIC support
--enable-compressed-hd allows compressed (zlib) hard disk image (not implemented yet)
@ -4370,7 +4371,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 4373 "configure"' > conftest.$ac_ext
echo '#line 4374 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@ -6572,11 +6573,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:6575: $lt_compile\"" >&5)
(eval echo "\"\$as_me:6576: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:6579: \$? = $ac_status" >&5
echo "$as_me:6580: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -6805,11 +6806,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:6808: $lt_compile\"" >&5)
(eval echo "\"\$as_me:6809: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:6812: \$? = $ac_status" >&5
echo "$as_me:6813: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -6872,11 +6873,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:6875: $lt_compile\"" >&5)
(eval echo "\"\$as_me:6876: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:6879: \$? = $ac_status" >&5
echo "$as_me:6880: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -9001,7 +9002,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 9004 "configure"
#line 9005 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -9099,7 +9100,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 9102 "configure"
#line 9103 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11274,11 +11275,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:11277: $lt_compile\"" >&5)
(eval echo "\"\$as_me:11278: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:11281: \$? = $ac_status" >&5
echo "$as_me:11282: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -11341,11 +11342,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:11344: $lt_compile\"" >&5)
(eval echo "\"\$as_me:11345: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:11348: \$? = $ac_status" >&5
echo "$as_me:11349: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -12651,7 +12652,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 12654 "configure"
#line 12655 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -12749,7 +12750,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 12752 "configure"
#line 12753 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -13572,11 +13573,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:13575: $lt_compile\"" >&5)
(eval echo "\"\$as_me:13576: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:13579: \$? = $ac_status" >&5
echo "$as_me:13580: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -13639,11 +13640,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:13642: $lt_compile\"" >&5)
(eval echo "\"\$as_me:13643: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:13646: \$? = $ac_status" >&5
echo "$as_me:13647: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -15650,11 +15651,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:15653: $lt_compile\"" >&5)
(eval echo "\"\$as_me:15654: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:15657: \$? = $ac_status" >&5
echo "$as_me:15658: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -15883,11 +15884,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:15886: $lt_compile\"" >&5)
(eval echo "\"\$as_me:15887: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:15890: \$? = $ac_status" >&5
echo "$as_me:15891: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -15950,11 +15951,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:15953: $lt_compile\"" >&5)
(eval echo "\"\$as_me:15954: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:15957: \$? = $ac_status" >&5
echo "$as_me:15958: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -18079,7 +18080,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 18082 "configure"
#line 18083 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -18177,7 +18178,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 18180 "configure"
#line 18181 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -20364,7 +20365,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 20367 "configure"
#line 20368 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -33159,6 +33160,39 @@ _ACEOF
fi
{ echo "$as_me:$LINENO: checking for larger than 32 bit physical address emulation" >&5
echo $ECHO_N "checking for larger than 32 bit physical address emulation... $ECHO_C" >&6; }
# Check whether --enable-long-phy-address was given.
if test "${enable_long_phy_address+set}" = set; then
enableval=$enable_long_phy_address; if test "$enableval" = yes; then
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
cat >>confdefs.h <<\_ACEOF
#define BX_PHY_ADDRESS_LONG 1
_ACEOF
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
cat >>confdefs.h <<\_ACEOF
#define BX_PHY_ADDRESS_LONG 0
_ACEOF
fi
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
cat >>confdefs.h <<\_ACEOF
#define BX_PHY_ADDRESS_LONG 0
_ACEOF
fi

View File

@ -2,7 +2,7 @@ dnl // Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(bochs.h)
AC_REVISION([[$Id: configure.in,v 1.388 2009-02-02 13:02:47 vruppert Exp $]])
AC_REVISION([[$Id: configure.in,v 1.389 2009-02-15 18:51:13 sshwarts Exp $]])
AC_CONFIG_HEADER(config.h)
AC_CONFIG_HEADER(ltdlconf.h)
@ -528,6 +528,23 @@ AC_ARG_ENABLE(smp,
]
)
AC_MSG_CHECKING(for larger than 32 bit physical address emulation)
AC_ARG_ENABLE(long-phy-address,
[ --enable-long-phy-address compile in support for physical address larger than 32 bit],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_PHY_ADDRESS_LONG, 1)
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_PHY_ADDRESS_LONG, 0)
fi
],
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_PHY_ADDRESS_LONG, 0)
]
)
AC_MSG_CHECKING(for cpu level)
AC_ARG_ENABLE(cpu-level,
[ --enable-cpu-level select cpu level (3,4,5,6)],

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: icache.h,v 1.41 2009-01-16 18:18:58 sshwarts Exp $
// $Id: icache.h,v 1.42 2009-02-15 18:51:13 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2007 Stanislav Shwartsman
@ -54,35 +54,46 @@ public:
}
~bxPageWriteStampTable() { delete [] pageWriteStampTable; }
BX_CPP_INLINE Bit32u hash(bx_phy_address pAddr) const {
#if BX_PHY_ADDRESS_LONG
// can share writeStamps between multiple pages
Bit32u lo = (pAddr >> 12) & (PHY_MEM_PAGES-1);
Bit32u hi = (pAddr >> 32) & (PHY_MEM_PAGES-1);
return lo ^ hi;
#else
return (Bit32u)(pAddr) >> 12;
#endif
}
BX_CPP_INLINE Bit32u getPageWriteStamp(bx_phy_address pAddr) const
{
return pageWriteStampTable[pAddr>>12];
return pageWriteStampTable[hash(pAddr)];
}
BX_CPP_INLINE const Bit32u *getPageWriteStampPtr(bx_phy_address pAddr) const
{
return &pageWriteStampTable[pAddr>>12];
return &pageWriteStampTable[hash(pAddr)];
}
BX_CPP_INLINE void setPageWriteStamp(bx_phy_address pAddr, Bit32u pageWriteStamp)
{
pageWriteStampTable[pAddr>>12] = pageWriteStamp;
pageWriteStampTable[hash(pAddr)] = pageWriteStamp;
}
BX_CPP_INLINE void decWriteStamp(bx_phy_address pAddr)
{
pAddr >>= 12;
Bit32u index = hash(pAddr);
#if BX_SUPPORT_TRACE_CACHE
if ((pageWriteStampTable[pAddr] & ICacheWriteStampFetchModeMask) != ICacheWriteStampFetchModeMask)
if ((pageWriteStampTable[index] & ICacheWriteStampFetchModeMask) != ICacheWriteStampFetchModeMask)
{
handleSMC(); // one of the CPUs might be running trace from this page
// Decrement page write stamp, so iCache entries with older stamps are
// effectively invalidated.
pageWriteStampTable[pAddr]--;
pageWriteStampTable[index]--;
}
#endif
#if BX_DEBUGGER
BX_DBG_DIRTY_PAGE(pAddr);
BX_DBG_DIRTY_PAGE(index);
#endif
}