X86: Make the TLB fault instead of panic when something is unmapped in SE mode.
authorGabe Black <gblack@eecs.umich.edu>
Mon, 23 Aug 2010 16:44:19 +0000 (09:44 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Mon, 23 Aug 2010 16:44:19 +0000 (09:44 -0700)
The fault object, if invoked, would then panic. This is a bit less direct, but
it means speculative execution won't panic the simulator.

src/arch/x86/faults.cc
src/arch/x86/faults.hh
src/arch/x86/tlb.cc

index 20b5a931e8bb6774f72e0360bc7b001fadd16a17..836a785675189d6f3567f72c5d7ae5a5e7aa0f89 100644 (file)
@@ -267,6 +267,22 @@ namespace X86ISA
         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
 
index 01d75fe17daba693c6062a84819f6c165e13b59f..bf3b6c8de4e63a5bbf41c1cda67ff099ca101c5e 100644 (file)
@@ -327,9 +327,9 @@ namespace X86ISA
             errorCode = code;
         }
 
-#if FULL_SYSTEM
         void invoke(ThreadContext * tc);
 
+#if FULL_SYSTEM
         virtual std::string describe() const;
 #endif
     };
index 43b1ba04ee44dcf476e29c9a880cf0c81839ed22..78efd5b693455a20e962de62daada39d5591d271 100644 (file)
@@ -619,21 +619,7 @@ TLB::translate(RequestPtr req, ThreadContext *tc, Translation *translation,
                     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,