changeset b1e69203bae9 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=b1e69203bae9
description:
X86: Make the TLB fault instead of panic when something is unmapped in
SE mode.
The fault object, if invoked, would then panic. This is a bit less
direct, but
it means speculative execution won't panic the simulator.
diffstat:
src/arch/x86/faults.cc | 16 ++++++++++++++++
src/arch/x86/faults.hh | 2 +-
src/arch/x86/tlb.cc | 16 +---------------
3 files changed, 18 insertions(+), 16 deletions(-)
diffs (66 lines):
diff -r 3f32191bcf66 -r b1e69203bae9 src/arch/x86/faults.cc
--- a/src/arch/x86/faults.cc Mon Aug 23 09:44:19 2010 -0700
+++ b/src/arch/x86/faults.cc Mon Aug 23 09:44:19 2010 -0700
@@ -267,6 +267,22 @@
tc->setNextPC(tc->readPC() + sizeof(MachInst));
}
+#else
+
+ void
+ PageFault::invoke(ThreadContext * tc)
+ {
+ PageFaultErrorCode code = errorCode;
+ const char *modeStr = "";
+ if (code.fetch)
+ modeStr = "execute";
+ else if (code.write)
+ modeStr = "write";
+ else
+ modeStr = "read";
+ panic("Tried to %s unmapped address %#x.\n", modeStr, addr);
+ }
+
#endif
} // namespace X86ISA
diff -r 3f32191bcf66 -r b1e69203bae9 src/arch/x86/faults.hh
--- a/src/arch/x86/faults.hh Mon Aug 23 09:44:19 2010 -0700
+++ b/src/arch/x86/faults.hh Mon Aug 23 09:44:19 2010 -0700
@@ -327,9 +327,9 @@
errorCode = code;
}
-#if FULL_SYSTEM
void invoke(ThreadContext * tc);
+#if FULL_SYSTEM
virtual std::string describe() const;
#endif
};
diff -r 3f32191bcf66 -r b1e69203bae9 src/arch/x86/tlb.cc
--- a/src/arch/x86/tlb.cc Mon Aug 23 09:44:19 2010 -0700
+++ b/src/arch/x86/tlb.cc Mon Aug 23 09:44:19 2010 -0700
@@ -619,21 +619,7 @@
success = p->pTable->lookup(vaddr, newEntry);
}
if (!success) {
- if (req->isPrefetch()) {
- return new PageFault(vaddr, true, mode, true, false);
- } else {
- const char *modeStr = "";
- if (mode == Execute)
- modeStr = "execute";
- else if (mode == Read)
- modeStr = "read";
- else if (mode == Write)
- modeStr = "write";
- else
- modeStr = "?";
- panic("Tried to %s unmapped address %#x.\n",
- modeStr, vaddr);
- }
+ return new PageFault(vaddr, true, mode, true, false);
} else {
Addr alignedVaddr = p->pTable->pageAlign(vaddr);
DPRINTF(TLB, "Mapping %#x to %#x\n", alignedVaddr,
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev