X86: Add a check to chks which raises #GP(selector) if selector is NULL or not in...
authorGabe Black <gblack@eecs.umich.edu>
Wed, 25 Feb 2009 18:16:54 +0000 (10:16 -0800)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 25 Feb 2009 18:16:54 +0000 (10:16 -0800)
src/arch/x86/isa/microasm.isa
src/arch/x86/isa/microops/regop.isa

index 778754e0c565ffb097b51941c6e5dd0c506ea7b8..354ee089e49078a3aad542236e4f9753596a73d2 100644 (file)
@@ -86,7 +86,8 @@ let {{
 
     # Add in symbols for the various checks of segment selectors.
     for check in ("NoCheck", "CSCheck", "CallGateCheck", "IntGateCheck",
-                  "SoftIntGateCheck", "SSCheck", "IretCheck", "IntCSCheck"):
+                  "SoftIntGateCheck", "SSCheck", "IretCheck", "IntCSCheck",
+                  "TRCheck"):
         assembler.symbols[check] = "Seg%s" % check
 
     for reg in ("TR", "IDTR"):
index 567335b7f15df09118db2504132334b2a45a55e6..9fb8b2f92025fc911d43f4e7ba7aa271839dea43 100644 (file)
@@ -234,7 +234,8 @@ output header {{
 
     enum SegmentSelectorCheck {
       SegNoCheck, SegCSCheck, SegCallGateCheck, SegIntGateCheck,
-      SegSoftIntGateCheck, SegSSCheck, SegIretCheck, SegIntCSCheck
+      SegSoftIntGateCheck, SegSSCheck, SegIretCheck, SegIntCSCheck,
+      SegTRCheck
     };
 
     enum LongModeDescriptorType {
@@ -1118,6 +1119,11 @@ let {{
                             "in legacy mode.\\n");
                 }
                 break;
+              case SegTRCheck:
+                if (!selector.si || selector.ti) {
+                    fault = new GeneralProtection(selector);
+                }
+                break;
               default:
                 panic("Undefined segment check type.\\n");
             }