From d548b9d8b7d2163d524c2a25ff0cb7e794e4e11d Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 3 Jul 2021 09:42:25 -0700 Subject: support pconfig/tme --- src/long_mode/display.rs | 2 ++ src/long_mode/mod.rs | 4 ++++ src/protected_mode/display.rs | 2 ++ src/protected_mode/mod.rs | 1 + test/long_mode/mod.rs | 2 +- 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs index 049b96d..5f74a3e 100644 --- a/src/long_mode/display.rs +++ b/src/long_mode/display.rs @@ -598,6 +598,7 @@ const MNEMONICS: &[&'static str] = &[ "vmlaunch", "vmresume", "vmxoff", + "pconfig", "monitor", "mwait", "monitorx", @@ -3131,6 +3132,7 @@ impl Colorize for Opcode { Opcode::VMSAVE | Opcode::VMRUN | Opcode::VMXOFF | + Opcode::PCONFIG | Opcode::MONITOR | Opcode::MWAIT | Opcode::MONITORX | diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs index 41e24e6..125716f 100644 --- a/src/long_mode/mod.rs +++ b/src/long_mode/mod.rs @@ -1295,6 +1295,7 @@ pub enum Opcode { VMLAUNCH, VMRESUME, VMXOFF, + PCONFIG, MONITOR, MWAIT, MONITORX, @@ -9157,6 +9158,9 @@ fn unlikely_operands::Address, { instruction.opcode = Opcode::VMXOFF; }, + 0b101 => { + instruction.opcode = Opcode::PCONFIG; + }, _ => { return Err(DecodeError::InvalidOpcode); } diff --git a/src/protected_mode/display.rs b/src/protected_mode/display.rs index 0736fc1..4f784d6 100644 --- a/src/protected_mode/display.rs +++ b/src/protected_mode/display.rs @@ -589,6 +589,7 @@ const MNEMONICS: &[&'static str] = &[ "vmlaunch", "vmresume", "vmxoff", + "pconfig", "monitor", "mwait", "monitorx", @@ -3142,6 +3143,7 @@ impl Colorize for Opcode { Opcode::VMSAVE | Opcode::VMRUN | Opcode::VMXOFF | + Opcode::PCONFIG | Opcode::MONITOR | Opcode::MWAIT | Opcode::MONITORX | diff --git a/src/protected_mode/mod.rs b/src/protected_mode/mod.rs index a1aac3f..46321d1 100644 --- a/src/protected_mode/mod.rs +++ b/src/protected_mode/mod.rs @@ -1213,6 +1213,7 @@ pub enum Opcode { VMLAUNCH, VMRESUME, VMXOFF, + PCONFIG, MONITOR, MWAIT, MONITORX, diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs index 1eedfec..98fc8b6 100644 --- a/test/long_mode/mod.rs +++ b/test/long_mode/mod.rs @@ -865,7 +865,7 @@ fn test_0f01() { test_display(&[0x0f, 0x01, 0xc2], "vmlaunch"); test_display(&[0x0f, 0x01, 0xc3], "vmresume"); test_display(&[0x0f, 0x01, 0xc4], "vmxoff"); - test_invalid(&[0x0f, 0x01, 0xc5]); // TODO: TME would make this `pconfig` + test_display(&[0x0f, 0x01, 0xc5], "pconfig"); test_invalid(&[0x0f, 0x01, 0xc6]); test_invalid(&[0x0f, 0x01, 0xc7]); test_display(&[0x0f, 0x01, 0xc8], "monitor"); -- cgit v1.1