summaryrefslogtreecommitdiff
path: root/src/arch/x86/tlb.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2008-06-12 00:52:12 -0400
committerGabe Black <gblack@eecs.umich.edu>2008-06-12 00:52:12 -0400
commit66f54a6037873420dbc3bc2c91723225538feddb (patch)
treefaad63a49ecf26057d96a65c64e10b860a34d8ae /src/arch/x86/tlb.cc
parent129831c116a6c7031093df624761f8d67bf4e115 (diff)
downloadgem5-66f54a6037873420dbc3bc2c91723225538feddb.tar.xz
X86: Change how segment loading is performed.
Diffstat (limited to 'src/arch/x86/tlb.cc')
-rw-r--r--src/arch/x86/tlb.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc
index 5d101a5ae..ba8f63a0e 100644
--- a/src/arch/x86/tlb.cc
+++ b/src/arch/x86/tlb.cc
@@ -574,14 +574,18 @@ TLB::translate(RequestPtr &req, ThreadContext *tc, bool write, bool execute)
// Check for a NULL segment selector.
if (!tc->readMiscRegNoEffect(MISCREG_SEG_SEL(seg)))
return new GeneralProtection(0);
- SegAttr attr = tc->readMiscRegNoEffect(MISCREG_SEG_ATTR(seg));
- if (!attr.writable && write)
- return new GeneralProtection(0);
- if (!attr.readable && !write && !execute)
- return new GeneralProtection(0);
+ bool expandDown = false;
+ if (seg >= SEGMENT_REG_ES && seg <= SEGMENT_REG_HS) {
+ SegAttr attr = tc->readMiscRegNoEffect(MISCREG_SEG_ATTR(seg));
+ if (!attr.writable && write)
+ return new GeneralProtection(0);
+ if (!attr.readable && !write && !execute)
+ return new GeneralProtection(0);
+ expandDown = attr.expandDown;
+ }
Addr base = tc->readMiscRegNoEffect(MISCREG_SEG_BASE(seg));
Addr limit = tc->readMiscRegNoEffect(MISCREG_SEG_LIMIT(seg));
- if (!attr.expandDown) {
+ if (expandDown) {
DPRINTF(TLB, "Checking an expand down segment.\n");
// We don't have to worry about the access going around the
// end of memory because accesses will be broken up into