aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2021-03-21 02:58:48 -0700
committeriximeow <me@iximeow.net>2021-03-21 02:58:48 -0700
commitd7b07d3eb6e6dc614fbc13cb66b951cb93daec44 (patch)
treec762755b87a42ccc297924270a8ee22b01355ad7
parentda8501f8463a106aec2d4389d71ab86add23a51a (diff)
xed says setssbsy and saveprevssp are more permissive
-rw-r--r--src/long_mode/mod.rs4
-rw-r--r--test/long_mode/mod.rs4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs
index 2d29835..6a85542 100644
--- a/src/long_mode/mod.rs
+++ b/src/long_mode/mod.rs
@@ -8326,7 +8326,7 @@ fn unlikely_operands<T: Iterator<Item=u8>>(decoder: &InstDecoder, mut bytes_iter
let m = modrm & 7;
match m {
0b000 => {
- if !instruction.prefixes.rep() || instruction.prefixes.operand_size() || instruction.prefixes.repnz() {
+ if !instruction.prefixes.rep() || instruction.prefixes.repnz() {
return Err(DecodeError::InvalidOpcode);
}
instruction.opcode = Opcode::SETSSBSY;
@@ -8334,7 +8334,7 @@ fn unlikely_operands<T: Iterator<Item=u8>>(decoder: &InstDecoder, mut bytes_iter
instruction.operand_count = 0;
}
0b010 => {
- if !instruction.prefixes.rep() || instruction.prefixes.operand_size() || instruction.prefixes.repnz() {
+ if !instruction.prefixes.rep() || instruction.prefixes.repnz() {
return Err(DecodeError::InvalidOpcode);
}
instruction.opcode = Opcode::SAVEPREVSSP;
diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs
index fa2e11d..8110d44 100644
--- a/test/long_mode/mod.rs
+++ b/test/long_mode/mod.rs
@@ -2284,6 +2284,10 @@ fn test_cet() {
test_invalid(&[0x66, 0x3e, 0x65, 0x3e, 0x0f, 0x38, 0xf5, 0xf0]);
test_display(&[0xf3, 0x0f, 0x01, 0xe8], "setssbsy");
test_display(&[0xf3, 0x0f, 0x01, 0xea], "saveprevssp");
+ test_display(&[0x66, 0xf3, 0x0f, 0x01, 0xe8], "setssbsy");
+ test_display(&[0x66, 0xf3, 0x0f, 0x01, 0xea], "saveprevssp");
+ test_display(&[0xf3, 0x66, 0x0f, 0x01, 0xe8], "setssbsy");
+ test_display(&[0xf3, 0x66, 0x0f, 0x01, 0xea], "saveprevssp");
test_display(&[0xf3, 0x0f, 0x01, 0x29], "rstorssp [rcx]");
test_display(&[0xf3, 0x66, 0x0f, 0x01, 0x29], "rstorssp [rcx]");
test_display(&[0xf3, 0x0f, 0xae, 0x30], "clrssbsy [rax]");