summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-04-19 04:57:51 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-04-19 04:57:51 -0700
commit6910baa0155a606c178ae0cd5e07bde150d7593e (patch)
treeadf9d6d23c360fa176f3a176eae1176241160d30 /src/arch/x86
parent0a6ff60caa27d2117438d0c6750977684252886a (diff)
downloadgem5-6910baa0155a606c178ae0cd5e07bde150d7593e.tar.xz
X86: Fix how the TLB handles the storecheck flag.
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/tlb.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc
index 330a8682b..9b4a397ee 100644
--- a/src/arch/x86/tlb.cc
+++ b/src/arch/x86/tlb.cc
@@ -197,9 +197,6 @@ TLB::translate(RequestPtr req, ThreadContext *tc, Translation *translation,
int seg = flags & SegmentFlagMask;
- //XXX Junk code to surpress the warning
- if (storeCheck);
-
// If this is true, we're dealing with a request to read an internal
// value.
if (seg == SEGMENT_REG_MS) {
@@ -579,7 +576,7 @@ TLB::translate(RequestPtr req, ThreadContext *tc, Translation *translation,
bool expandDown = false;
SegAttr attr = tc->readMiscRegNoEffect(MISCREG_SEG_ATTR(seg));
if (seg >= SEGMENT_REG_ES && seg <= SEGMENT_REG_HS) {
- if (!attr.writable && mode == Write)
+ if (!attr.writable && (mode == Write || storeCheck))
return new GeneralProtection(0);
if (!attr.readable && mode == Read)
return new GeneralProtection(0);
@@ -655,6 +652,11 @@ TLB::translate(RequestPtr req, ThreadContext *tc, Translation *translation,
// fine even though we're not checking them.
return new PageFault(vaddr, true, mode, inUser, false);
}
+ if (storeCheck && !entry->writable) {
+ // This would fault if this were a write, so return a page
+ // fault that reflects that happening.
+ return new PageFault(vaddr, true, Write, inUser, false);
+ }
DPRINTF(TLB, "Entry found with paddr %#x, "