History log of /cloud-hypervisor/hypervisor/src/arch/x86/emulator/instructions/mov.rs (Results 1 – 25 of 26)
Revision Date Author Comments
# 297236a7 30-Sep-2024 Ruoqing He <heruoqing@iscas.ac.cn>

misc: Eliminate use of `assert!((...).is_ok())`

Asserting on .is_ok()/.is_err() leads to hard to debug failures (as if
the test fails, it will only say "assertion failed: false". We replace
these wi

misc: Eliminate use of `assert!((...).is_ok())`

Asserting on .is_ok()/.is_err() leads to hard to debug failures (as if
the test fails, it will only say "assertion failed: false". We replace
these with `.unwrap()`, which also prints the exact error variant that
was unexpectedly encountered (we can to this these days thanks to
efforts to implement Display and Debug for our error types). If the
assert!((...).is_ok()) was followed by an .unwrap() anyway, we just drop
the assert.

Inspired by and quoted from @roypat.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>

show more ...


# c721c0d8 19-Mar-2024 Rob Bradford <rbradford@rivosinc.com>

hypervisor: emulator: Remove unnecessary #![allow(unused_mut)]

clippy was flagging this up as a mixture of mixed attributes but that
attribute is no longer necessary

warning: item has both inner an

hypervisor: emulator: Remove unnecessary #![allow(unused_mut)]

clippy was flagging this up as a mixture of mixed attributes but that
attribute is no longer necessary

warning: item has both inner and outer attributes
--> hypervisor/src/arch/x86/emulator/mod.rs:769:1
|
769 | / #[cfg(test)]
770 | | mod tests {
771 | | #![allow(unused_mut)]
| |_________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mixed_attributes_style
= note: `#[warn(clippy::mixed_attributes_style)]` on by default

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>

show more ...


# adb318f4 19-Feb-2024 Rob Bradford <rbradford@rivosinc.com>

misc: Remove redundant "use" imports

With the nightly toolchain (2024-02-18) cargo check will flag up
redundant imports either because they are pulled in by the prelude on
earlier match.

Remove tho

misc: Remove redundant "use" imports

With the nightly toolchain (2024-02-18) cargo check will flag up
redundant imports either because they are pulled in by the prelude on
earlier match.

Remove those redundant imports.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>

show more ...


# 442ac905 31-Jul-2023 Philipp Schuster <philipp.schuster@cyberus-technology.de>

x86 emulator: add Mov_moffs_AX & Mov_AX_moffs (16,32,64)

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>


# 496ceed1 11-May-2021 Rob Bradford <robert.bradford@intel.com>

misc: Remove unnecessary "extern crate"

Now all crates use edition = "2018" then the majority of the "extern
crate" statements can be removed. Only those for importing macros need
to remain.

Signed

misc: Remove unnecessary "extern crate"

Now all crates use edition = "2018" then the majority of the "extern
crate" statements can be removed. Only those for importing macros need
to remain.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>

show more ...


# 0c27f69f 25-Mar-2021 Rob Bradford <robert.bradford@intel.com>

hypervisor: Address Rust 1.51.0 clippy issue (upper_case_acroynms)

warning: name `TranslateGVA` contains a capitalized acronym
--> hypervisor/src/arch/emulator/mod.rs:51:5
|
51 | TranslateG

hypervisor: Address Rust 1.51.0 clippy issue (upper_case_acroynms)

warning: name `TranslateGVA` contains a capitalized acronym
--> hypervisor/src/arch/emulator/mod.rs:51:5
|
51 | TranslateGVA(#[source] anyhow::Error),
| ^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `TranslateGva`
|
= note: `#[warn(clippy::upper_case_acronyms)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

Signed-off-by: Rob Bradford <robert.bradford@intel.com>

show more ...


# 49214cf0 22-Feb-2021 Wei Liu <liuwe@microsoft.com>

hypervisor: emulator: fix MOVZX

According to Intel's mnemonic (which is used by iced-x86) the first
argument is destination while the second is source.

Signed-off-by: Wei Liu <liuwe@microsoft.com>


# 9c5be6f6 11-Feb-2021 Rob Bradford <robert.bradford@intel.com>

build: Remove unnecessary Result<> returns

If the function can never return an error this is now a clippy failure:

error: this function's return value is unnecessarily wrapped by `Result`
--> vi

build: Remove unnecessary Result<> returns

If the function can never return an error this is now a clippy failure:

error: this function's return value is unnecessarily wrapped by `Result`
--> virtio-devices/src/watchdog.rs:215:5
|
215 | / fn set_state(&mut self, state: &WatchdogState) -> io::Result<()> {
216 | | self.common.avail_features = state.avail_features;
217 | | self.common.acked_features = state.acked_features;
218 | | // When restoring enable the watchdog if it was previously enabled. We reset the timer
... |
223 | | Ok(())
224 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps

Signed-off-by: Rob Bradford <robert.bradford@intel.com>

show more ...


# f4159ca0 30-Dec-2020 Wei Liu <liuwe@microsoft.com>

hypervisor: emulator: drop useless set_ip calls

The instruction pointer is already pointing at the instruction being
emulated.

Signed-off-by: Wei Liu <liuwe@microsoft.com>


# eee218f1 02-Feb-2021 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: emulator: Add MOVZX unit tests

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 5ada3f59 02-Feb-2021 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: emulator: Emulate MOVZX

MOV R/RM is a special case of MOVZX, so we generalize the mov_r_rm macro
to make it support both instructions.

Fixes: #2227

Signed-off-by: Samuel Ortiz <sameo@l

hypervisor: emulator: Emulate MOVZX

MOV R/RM is a special case of MOVZX, so we generalize the mov_r_rm macro
to make it support both instructions.

Fixes: #2227

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

show more ...


# fabd6307 02-Jan-2021 Rob Bradford <robert.bradford@intel.com>

misc: Remove unnecessary literal casts

Signed-off-by: Rob Bradford <robert.bradford@intel.com>


# a44d96c9 05-Dec-2020 Wei Liu <liuwe@microsoft.com>

hypervisor: emulator: switch to use vec in MockVMM

The customized hashmap macro can't be lifted to common MockVMM code.
MockVMM only needs a collection to iterate over to get initial register
states

hypervisor: emulator: switch to use vec in MockVMM

The customized hashmap macro can't be lifted to common MockVMM code.
MockVMM only needs a collection to iterate over to get initial register
states. A vector is just as good as a hashmap.

Switch to use a vector to store initial register states. This allows us
to drop the hashmap macro everywhere.

Signed-off-by: Wei Liu <liuwe@microsoft.com>

show more ...


# 0c3ef986 05-Dec-2020 Wei Liu <liuwe@microsoft.com>

hypervisor: emulator: rewrite MOV emulation with get/set_op

Signed-off-by: Wei Liu <liuwe@microsoft.com>


# 90ae4676 03-Dec-2020 Wei Liu <liuwe@microsoft.com>

hypervisor: x86: emulator: drop unneeded curly brackets

There is no need to have a pair of curly brackets for structures without
any member.

No functional change.

Signed-off-by: Wei Liu <liuwe@mic

hypervisor: x86: emulator: drop unneeded curly brackets

There is no need to have a pair of curly brackets for structures without
any member.

No functional change.

Signed-off-by: Wei Liu <liuwe@microsoft.com>

show more ...


# 3fa6e17c 30-Nov-2020 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: x86: Make imm_op available to all emulated instructions

By moving it to the instructions root module.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# e2c81f9e 30-Nov-2020 Wei Liu <liuwe@microsoft.com>

hypervisor: x86: Extend the imm_op() macro

To support every kind of immediate operands.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# f6892f2e 27-Nov-2020 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: emulator: Add a negative instruction fetch unit test

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 25143486 27-Nov-2020 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: emulator: Fix logic bug in MockVMM

emulate_first_insn() really means we want only the first instruction to
be emulated.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 1ac4c42a 26-Nov-2020 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: emulator: Add initial fetch support

When the x86 instruction decoder tells us about some missing bytes from
the instruction stream, we call into the platform fetch method and
emulate one

hypervisor: emulator: Add initial fetch support

When the x86 instruction decoder tells us about some missing bytes from
the instruction stream, we call into the platform fetch method and
emulate one last instruction.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

show more ...


# 7a4edecd 26-Nov-2020 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: x86: Add an address linearization method to CpuStateManager

From a CPU state and a segment, we can translate a logical (segmented)
address into a linear one.

Signed-off-by: Samuel Ortiz

hypervisor: x86: Add an address linearization method to CpuStateManager

From a CPU state and a segment, we can translate a logical (segmented)
address into a linear one.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

show more ...


# a3d957ba 27-Nov-2020 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: emulator: Clean the MockVMM initialization path

Separate the standalone _init_and_run() function into 2 MockVMM methods:
new() and emulate_insn().

Signed-off-by: Samuel Ortiz <sameo@lin

hypervisor: emulator: Clean the MockVMM initialization path

Separate the standalone _init_and_run() function into 2 MockVMM methods:
new() and emulate_insn().

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

show more ...


# 5bd63efa 27-Nov-2020 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: emulator: Move MockVMM into a shared test module

The MockVMM platform will be used by other instructions emulation
implementations, but also by the emulator framework.

Signed-off-by: Sa

hypervisor: emulator: Move MockVMM into a shared test module

The MockVMM platform will be used by other instructions emulation
implementations, but also by the emulator framework.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

show more ...


# 66b00166 26-Nov-2020 Wei Liu <liuwe@microsoft.com>

hypervisor: x86: only calculate address when necessary in MOV emulation

Only calculate the address when the operand is memory.

Signed-off-by: Wei Liu <liuwe@microsoft.com>


# c8b65549 25-Nov-2020 Wei Liu <liuwe@microsoft.com>

hypervisor: x86: reference PlatformEmulator in Emulator

The observation here is PlatformEmulator can be seen as the context for
emulation to take place. It should be rather easy to construct a conte

hypervisor: x86: reference PlatformEmulator in Emulator

The observation here is PlatformEmulator can be seen as the context for
emulation to take place. It should be rather easy to construct a context
that satisfies the lifetime constraints for instruction emulation.

The thread doing the emulation will have full ownership over the
context, so this removes the need to wrap PlatformEmulator in Arc and
Mutex, as well as the need for the context to be either Clone or Copy.

Signed-off-by: Wei Liu <liuwe@microsoft.com>

show more ...


12