From f4159ca0165cf2d8c9c5a19b996105ccedf42533 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Wed, 30 Dec 2020 20:31:20 +0000 Subject: [PATCH] hypervisor: emulator: drop useless set_ip calls The instruction pointer is already pointing at the instruction being emulated. Signed-off-by: Wei Liu --- hypervisor/src/arch/x86/emulator/instructions/cmp.rs | 6 ------ hypervisor/src/arch/x86/emulator/instructions/mov.rs | 8 -------- 2 files changed, 14 deletions(-) diff --git a/hypervisor/src/arch/x86/emulator/instructions/cmp.rs b/hypervisor/src/arch/x86/emulator/instructions/cmp.rs index fc0d73dad..82559f235 100644 --- a/hypervisor/src/arch/x86/emulator/instructions/cmp.rs +++ b/hypervisor/src/arch/x86/emulator/instructions/cmp.rs @@ -71,8 +71,6 @@ macro_rules! cmp_rm_r { state.set_flags((state.flags() & !FLAGS_MASK) | cpazso); - state.set_ip(insn.ip()); - Ok(()) } }; @@ -95,8 +93,6 @@ macro_rules! cmp_r_rm { state.set_flags((state.flags() & !FLAGS_MASK) | cpazso); - state.set_ip(insn.ip()); - Ok(()) } }; @@ -119,8 +115,6 @@ macro_rules! cmp_rm_imm { state.set_flags((state.flags() & !FLAGS_MASK) | cpazso); - state.set_ip(insn.ip()); - Ok(()) } }; diff --git a/hypervisor/src/arch/x86/emulator/instructions/mov.rs b/hypervisor/src/arch/x86/emulator/instructions/mov.rs index 406319037..da1e2f956 100644 --- a/hypervisor/src/arch/x86/emulator/instructions/mov.rs +++ b/hypervisor/src/arch/x86/emulator/instructions/mov.rs @@ -39,8 +39,6 @@ macro_rules! mov_rm_r { ) .map_err(EmulationError::PlatformEmulationError)?; - state.set_ip(insn.ip()); - Ok(()) } }; @@ -67,8 +65,6 @@ macro_rules! mov_rm_imm { ) .map_err(EmulationError::PlatformEmulationError)?; - state.set_ip(insn.ip()); - Ok(()) } }; @@ -101,8 +97,6 @@ macro_rules! movzx { ) .map_err(EmulationError::PlatformEmulationError)?; - state.set_ip(insn.ip()); - Ok(()) } }; @@ -136,8 +130,6 @@ macro_rules! mov_r_imm { ) .map_err(EmulationError::PlatformEmulationError)?; - state.set_ip(insn.ip()); - Ok(()) } };