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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55825
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2022-01-23 10:01:02 -08:00
parent 141d44b979
commit 64d00f83c4

View File

@@ -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();