X86: Fix a bad segmentation check for the stack segment.
authorGabe Black <gblack@eecs.umich.edu>
Thu, 1 Dec 2011 05:17:14 +0000 (00:17 -0500)
committerGabe Black <gblack@eecs.umich.edu>
Thu, 1 Dec 2011 05:17:14 +0000 (00:17 -0500)
--HG--
extra : rebase_source : 755f4f6eae52f88ed516a1f1ac9e2565725d89c1

src/arch/x86/isa/microops/regop.isa

index a6e0564baa67d0e7775314780e5aaf9e81f06ad1..bc139a609ddcdb916a2ee533e60dbe114647f20b 100644 (file)
@@ -1335,16 +1335,15 @@ let {{
                 if (selector.si || selector.ti) {
                     if (!desc.p) {
                         fault = new StackFault(selector);
-                    }
-                } else {
-                    if ((m5reg.submode != SixtyFourBitMode ||
-                                m5reg.cpl == 3) ||
-                            !(desc.s == 1 &&
-                            desc.type.codeOrData == 0 && desc.type.w) ||
+                    } else if (!(desc.s == 1 && desc.type.codeOrData == 0 &&
+                                desc.type.w) ||
                             (desc.dpl != m5reg.cpl) ||
                             (selector.rpl != m5reg.cpl)) {
                         fault = new GeneralProtection(selector);
                     }
+                } else if (m5reg.submode != SixtyFourBitMode ||
+                        m5reg.cpl == 3) {
+                    fault = new GeneralProtection(selector);
                 }
                 break;
               case SegIretCheck: