Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/55825 )

Change subject: arch-x86: Ensure moving to %cs faults even in real mode.
......................................................................

arch-x86: Ensure moving to %cs faults even in real mode.

It's always illegal to try to use the "mov" instruction to move a
selector into %cs. That was implemented for normal mov-s, but not for
the real mode version.

Change-Id: Ida8ec323fd7428ece583ad01cd5095d5f9630c9d
---
M src/arch/x86/isa/decoder/one_byte_opcodes.isa
1 file changed, 23 insertions(+), 5 deletions(-)



diff --git a/src/arch/x86/isa/decoder/one_byte_opcodes.isa b/src/arch/x86/isa/decoder/one_byte_opcodes.isa
index 878dab2..104d205 100644
--- a/src/arch/x86/isa/decoder/one_byte_opcodes.isa
+++ b/src/arch/x86/isa/decoder/one_byte_opcodes.isa
@@ -293,13 +293,18 @@
             }
             0x5: LEA(Gv,M);
             0x6: decode MODE_SUBMODE {
-                0x3, 0x4: MOV_REAL(Sv,Ev);
+                0x3, 0x4: decode MODRM_REG {
+ // Moving to the CS selector (0x1) is illegal, and 0x6 and
+                    // 0x7 are reserved.
+                    0x1, 0x6, 0x7: UD2();
+                    default: MOV_REAL(Sv,Ev);
+                }
                 default: decode MODRM_REG {
-                    0x1: UD2(); // Moving to the CS selector is illegal.
+ // Moving to the CS selector (0x1) is illegal, and 0x6 and
+                    // 0x7 are reserved.
+                    0x1, 0x6, 0x7: UD2();
                     0x2: MOVSS(Sv,Ev);
-                    0x0, 0x3,
-                    0x4, 0x5: MOV(Sv,Ev);
-                    default: UD2();
+                    default: MOV(Sv,Ev);
                 }
             }
             //0x7: group10_Ev();

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/55825
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ida8ec323fd7428ece583ad01cd5095d5f9630c9d
Gerrit-Change-Number: 55825
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to