X86: Make unrecognized instructions behave better in x86.
authorGabe Black <gblack@eecs.umich.edu>
Tue, 14 Sep 2010 19:27:30 +0000 (12:27 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Tue, 14 Sep 2010 19:27:30 +0000 (12:27 -0700)
src/arch/x86/faults.cc
src/arch/x86/faults.hh
src/arch/x86/isa/formats/unknown.isa

index 4c8fb33c2ce191b51e68a06afd98a856082567d3..4f2d97f90b17db0f94f7cf27d87ef77af7ad7aa0 100644 (file)
@@ -269,6 +269,13 @@ namespace X86ISA
 
 #else
 
+    void
+    InvalidOpcode::invoke(ThreadContext * tc, StaticInstPtr inst)
+    {
+        panic("Unrecognized/invalid instruction executed:\n %s",
+                inst->machInst);
+    }
+
     void
     PageFault::invoke(ThreadContext * tc, StaticInstPtr inst)
     {
index f98ef72e93273e49aa1200c94e6ee97c62c52a92..cfb654b62885e940fdbc5f1422f50c54a404423f 100644 (file)
@@ -250,6 +250,11 @@ namespace X86ISA
         InvalidOpcode() :
             X86Fault("Invalid-Opcode", "#UD", 6)
         {}
+
+#if !FULL_SYSTEM
+        void invoke(ThreadContext * tc,
+                StaticInstPtr inst = StaticInst::nullStaticInstPtr);
+#endif
     };
 
     class DeviceNotAvailable : public X86Fault
index 9b283b5d787943cbd482e96b1adb6acb4d67d380..11751e86163fa8eb2ceefec5c9a4dc614d544bce 100644 (file)
@@ -77,8 +77,7 @@ output exec {{
         Fault Unknown::execute(%(CPU_exec_context)s *xc,
                 Trace::InstRecord *traceData) const
         {
-            warn("No instructions are implemented for X86!\n");
-            return NoFault;
+            return new InvalidOpcode();
         }
 }};