X86: Add a check to chks to verify a task state segment descriptor.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 25 Feb 2009 18:17:02 +0000 (10:17 -0800)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 25 Feb 2009 18:17:02 +0000 (10:17 -0800)
src/arch/x86/isa/microasm.isa
src/arch/x86/isa/microops/regop.isa

index 354ee089e49078a3aad542236e4f9753596a73d2..d1025b1376e502ea3bebbbecec2274580975b8ef 100644 (file)
@@ -87,7 +87,7 @@ let {{
     # Add in symbols for the various checks of segment selectors.
     for check in ("NoCheck", "CSCheck", "CallGateCheck", "IntGateCheck",
                   "SoftIntGateCheck", "SSCheck", "IretCheck", "IntCSCheck",
-                  "TRCheck"):
+                  "TRCheck", "TSSCheck"):
         assembler.symbols[check] = "Seg%s" % check
 
     for reg in ("TR", "IDTR"):
index 9fb8b2f92025fc911d43f4e7ba7aa271839dea43..0d569d403ac6cbe319e631b1948dbdf410d45f8b 100644 (file)
@@ -235,7 +235,7 @@ output header {{
     enum SegmentSelectorCheck {
       SegNoCheck, SegCSCheck, SegCallGateCheck, SegIntGateCheck,
       SegSoftIntGateCheck, SegSSCheck, SegIretCheck, SegIntCSCheck,
-      SegTRCheck
+      SegTRCheck, SegTSSCheck
     };
 
     enum LongModeDescriptorType {
@@ -1124,6 +1124,15 @@ let {{
                     fault = new GeneralProtection(selector);
                 }
                 break;
+              case SegTSSCheck:
+                if (!desc.p) {
+                    fault = new SegmentNotPresent(selector);
+                } else if (!(desc.type == 0x9 ||
+                        (desc.type == 1 &&
+                         m5reg.mode != LongMode))) {
+
+                }
+                break;
               default:
                 panic("Undefined segment check type.\\n");
             }