aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2026-06-09 07:58:47 +0000
committeriximeow <me@iximeow.net>2026-07-05 00:09:22 +0000
commit9b98d9052a18b69bc080d106539d886ee28ab57c (patch)
tree162836c173c348fecf2ca198f70dc21b7ba2ac68 /test
parent1523e9cf613e1092b80bc10cd28e7986d2c28d02 (diff)
fix seam, user-ipi, {rd,wr}{fs,gs}base instructions decoding outside 64b mode
Diffstat (limited to 'test')
-rw-r--r--test/protected_mode/mod.rs36
1 files changed, 19 insertions, 17 deletions
diff --git a/test/protected_mode/mod.rs b/test/protected_mode/mod.rs
index 0d3dd07..be16635 100644
--- a/test/protected_mode/mod.rs
+++ b/test/protected_mode/mod.rs
@@ -2356,10 +2356,10 @@ mod misc {
testcase!(&[0xf3, 0x0f, 0xae, 0x26], "ptwrite dword [esi]"),
testcase!(&[0xf3, 0x0f, 0xae, 0xe6], "ptwrite esi"),
testcase!(invalid: &[0x66, 0xf3, 0x0f, 0xae, 0xe6]),
- testcase!(&[0xf3, 0x0f, 0xae, 0xc4], "rdfsbase esp"),
- testcase!(&[0xf3, 0x0f, 0xae, 0xcc], "rdgsbase esp"),
- testcase!(&[0xf3, 0x0f, 0xae, 0xd4], "wrfsbase esp"),
- testcase!(&[0xf3, 0x0f, 0xae, 0xdc], "wrgsbase esp"),
+ testcase!(invalid: &[0xf3, 0x0f, 0xae, 0xc4]), // "rdfsbase esp", > The RDFSBASE and RDGSBASE instructions are not recognized in protected mode.
+ testcase!(invalid: &[0xf3, 0x0f, 0xae, 0xcc]), // "rdgsbase esp", > The RDFSBASE and RDGSBASE instructions are not recognized in protected mode.
+ testcase!(invalid: &[0xf3, 0x0f, 0xae, 0xd4]), // "wrfsbase esp", > The WRFSBASE and WRGSBASE instructions are not recognized in protected mode.
+ testcase!(invalid: &[0xf3, 0x0f, 0xae, 0xdc]), // "wrgsbase esp", > The WRFSBASE and WRGSBASE instructions are not recognized in protected mode.
testcase!(&[0x66, 0x0f, 0xae, 0x3f], "clflushopt zmmword [edi]"), // or clflush without 66
testcase!(invalid: &[0x66, 0x0f, 0xae, 0xff]),
testcase!(&[0x66, 0x0f, 0xae, 0x37], "clwb zmmword [edi]"),
@@ -3362,10 +3362,10 @@ mod vex {
testcase!(features { AVX: true } &[0xc5, 0xf8, 0x10, 0x01], "vmovups xmm0, xmmword [ecx]"),
];
- #[test]
- fn test() {
- run_test(CASES);
- }
+ #[test]
+ fn test() {
+ run_test(CASES);
+ }
}
mod strange_prefixing {
@@ -4376,16 +4376,18 @@ mod key_locker {
// these uinter test cases come from llvm:
// https://reviews.llvm.org/differential/changeset/?ref=2226860
+//
+// as it turns out, UINTR is not supported at all in protected or real mode.
mod uintr {
use crate::protected_mode::{TestCase, run_test};
const CASES: &'static [TestCase] = &[
- testcase!(&[0xf3, 0x0f, 0x01, 0xec], "uiret"),
- testcase!(&[0xf3, 0x0f, 0x01, 0xed], "testui"),
- testcase!(&[0xf3, 0x0f, 0x01, 0xee], "clui"),
- testcase!(&[0xf3, 0x0f, 0x01, 0xef], "stui"),
- testcase!(&[0xf3, 0x0f, 0xc7, 0xf0], "senduipi eax"),
- testcase!(&[0xf3, 0x0f, 0xc7, 0xf2], "senduipi edx"),
+ testcase!(invalid: &[0xf3, 0x0f, 0x01, 0xec]), // "uiret"
+ testcase!(invalid: &[0xf3, 0x0f, 0x01, 0xed]), // "testui"
+ testcase!(invalid: &[0xf3, 0x0f, 0x01, 0xee]), // "clui"
+ testcase!(invalid: &[0xf3, 0x0f, 0x01, 0xef]), // "stui"
+ testcase!(invalid: &[0xf3, 0x0f, 0xc7, 0xf0]), // "senduipi eax"
+ testcase!(invalid: &[0xf3, 0x0f, 0xc7, 0xf2]), // "senduipi edx"
];
#[test]
@@ -4429,9 +4431,9 @@ mod tdx {
const CASES: &'static [TestCase] = &[
testcase!(&[0x66, 0x0f, 0x01, 0xcc], "tdcall"),
- testcase!(&[0x66, 0x0f, 0x01, 0xcd], "seamret"),
- testcase!(&[0x66, 0x0f, 0x01, 0xce], "seamops"),
- testcase!(&[0x66, 0x0f, 0x01, 0xcf], "seamcall"),
+ testcase!(invalid: &[0x66, 0x0f, 0x01, 0xcd]), // "seamret" is long-mode only
+ testcase!(invalid: &[0x66, 0x0f, 0x01, 0xce]), // "seamops" is long-mode only
+ testcase!(invalid: &[0x66, 0x0f, 0x01, 0xcf]), // "seamcall" is long-mode only
];
#[test]