X86: Some segment selectors can be used when "NULL".
authorGabe Black <gblack@eecs.umich.edu>
Sun, 19 Apr 2009 10:41:10 +0000 (03:41 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Sun, 19 Apr 2009 10:41:10 +0000 (03:41 -0700)
src/arch/x86/tlb.cc

index 62d6942251d5a2941d616ce1fea137568cddb49e..330a8682b4a29c33d00361c66d7e1d2ec5eb2c9f 100644 (file)
@@ -571,7 +571,10 @@ TLB::translate(RequestPtr req, ThreadContext *tc, Translation *translation,
         if (!efer.lma || !csAttr.longMode) {
             DPRINTF(TLB, "Not in long mode. Checking segment protection.\n");
             // Check for a NULL segment selector.
-            if (!tc->readMiscRegNoEffect(MISCREG_SEG_SEL(seg)))
+            if (!(seg == SEGMENT_REG_TSG || seg == SYS_SEGMENT_REG_IDTR ||
+                        seg == SEGMENT_REG_HS || seg == SEGMENT_REG_LS ||
+                        seg == SEGMENT_REG_MS)
+                    && !tc->readMiscRegNoEffect(MISCREG_SEG_SEL(seg)))
                 return new GeneralProtection(0);
             bool expandDown = false;
             SegAttr attr = tc->readMiscRegNoEffect(MISCREG_SEG_ATTR(seg));