changeset 606b9525071d in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=606b9525071d
description:
        X86: Make the chks microop check for the right int descriptor type.

diffstat:

2 files changed, 7 insertions(+), 10 deletions(-)
src/arch/x86/isa/insts/romutil.py   |   11 +----------
src/arch/x86/isa/microops/regop.isa |    6 ++++++

diffs (42 lines):

diff -r 1a40b07bbc30 -r 606b9525071d src/arch/x86/isa/insts/romutil.py
--- a/src/arch/x86/isa/insts/romutil.py Sun Feb 01 17:04:21 2009 -0800
+++ b/src/arch/x86/isa/insts/romutil.py Sun Feb 01 17:05:37 2009 -0800
@@ -43,18 +43,9 @@
     ld t2, idtr, [1, t0, t4], 8, dataSize=8, addressSize=8
     ld t4, idtr, [1, t0, t4], dataSize=8, addressSize=8
 
-    # Check permissions
+    # Make sure the descriptor is a legal gate.
     chks t1, t4, IntGateCheck
 
-    mov t1, t1, t4, dataSize=8
-
-    # Check that it's the right type
-    srli t4, t1, 40, dataSize=8
-    andi t4, t4, 0xe, dataSize=8
-    xori t4, t4, 0xe, flags=(EZF,), dataSize=8
-    fault "new GeneralProtection(0)", flags=(nCEZF,)
-
-
     #
     # Get the target CS descriptor using the selector in the gate
     # descriptor.
diff -r 1a40b07bbc30 -r 606b9525071d src/arch/x86/isa/microops/regop.isa
--- a/src/arch/x86/isa/microops/regop.isa       Sun Feb 01 17:04:21 2009 -0800
+++ b/src/arch/x86/isa/microops/regop.isa       Sun Feb 01 17:05:37 2009 -0800
@@ -1067,9 +1067,15 @@
                         "not implemented.\\n");
                 break;
               case SegIntGateCheck:
+                // Check permissions.
                 if (desc.dpl < m5reg.cpl) {
                     fault = new GeneralProtection((uint16_t)selector);
                 }
+                // Make sure the gate's the right type.
+                if (m5reg.mode == LongMode && ((desc.type & 0xe) != 0xe) ||
+                        ((desc.type & 0x6) != 0x6)) {
+                    fault = new GeneralProtection(0);
+                }
                 break;
               case SegSSCheck:
                 if (selector.si || selector.ti) {
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to