History log of /cloud-hypervisor/hypervisor/src/arch/x86/emulator/instructions/mod.rs (Results 1 – 25 of 25)
Revision Date Author Comments
# 73e1451a 02-Jan-2025 Wei Liu <liuwe@microsoft.com>

hypervisor: emulator: use wrapping arithmetic

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


# 1180f757 02-Jan-2025 Wei Liu <liuwe@microsoft.com>

hypervisor: emulator: adjust iced-x86 feature flags

The fastfmt feature and VEX support use techniques that appear to leak
memory in the eye of LLVM's address sanitizer.

While at it, disable a bunc

hypervisor: emulator: adjust iced-x86 feature flags

The fastfmt feature and VEX support use techniques that appear to leak
memory in the eye of LLVM's address sanitizer.

While at it, disable a bunch of instruction set decoding support we
never intend to support.

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

show more ...


# 88a9f799 29-Sep-2024 Rob Bradford <rbradford@rivosinc.com>

misc: Adapt consistent import style formatting

Historically the Cloud Hypervisor coding style has been to ensure that
all imports are ordered and placed in a single group. Unfortunately
cargo fmt ha

misc: Adapt consistent import style formatting

Historically the Cloud Hypervisor coding style has been to ensure that
all imports are ordered and placed in a single group. Unfortunately
cargo fmt has no support for ensuring that all imports are in a single
group so if whitespace lines were added as part of the import statements
then they would only be odered correctly in the group.

By adopting "group_imports="StdExternalCrate" we can enforce a style
where imports are placed in at most three groups for std, external
crates and the crate itself. Choosing a style enforceable by the tooling
reduces the reviewer burden.

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

show more ...


# 824e83ab 17-Jul-2024 Wei Liu <liuwe@microsoft.com>

hypervisor: x86: emulate STOS

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


# 556bda74 31-Aug-2023 Philipp Schuster <philipp.schuster@cyberus-technology.de>

hypervisor: emulator: Use wrapping add for memory offset

Assume rax is 0xfee003e0 and the displacement is negative 0x60. The effective
address is then 0xfee00380. This is perfectly valid.

Example i

hypervisor: emulator: Use wrapping add for memory offset

Assume rax is 0xfee003e0 and the displacement is negative 0x60. The effective
address is then 0xfee00380. This is perfectly valid.

Example instruction:
c7 40 a0 00 10 00 00 movl $0x1000,-0x60(%rax)

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

show more ...


# 239f4222 22-Aug-2023 Rob Bradford <rbradford@rivosinc.com>

hypervisor: x86: emulator: Remove unncessary mut from reference

warning: this argument is a mutable reference, but not used mutably
--> hypervisor/src/arch/x86/emulator/instructions/mod.rs:22:15

hypervisor: x86: emulator: Remove unncessary mut from reference

warning: this argument is a mutable reference, but not used mutably
--> hypervisor/src/arch/x86/emulator/instructions/mod.rs:22:15
|
22 | platform: &mut dyn PlatformEmulator<CpuState = T>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&dyn PlatformEmulator<CpuState = T>`
|
= note: this is cfg-gated and may require further changes
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

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

show more ...


# a9ec0f33 01-Nov-2022 Bo Chen <chen.bo@intel.com>

misc: Fix clippy issues

Signed-off-by: Bo Chen <chen.bo@intel.com>


# 2f514523 23-Jun-2022 Wei Liu <liuwe@microsoft.com>

hypervisor: emulator: use matches!

No functional change. Just make the code a bit nicer to read.

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


# c419d328 07-Jun-2021 Wei Liu <liuwe@microsoft.com>

hypervisor: emulator: emulate OR instruction

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


# 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 ...


# d370ea58 22-Mar-2021 Sebastien Boeuf <sebastien.boeuf@intel.com>

deps: bump iced-x86 from 1.10.3 to 1.11.0

Bumps iced-x86 from 1.10.3 to 1.11.0.

Manual update of the code was needed since memory_displacement() was
deprecated and replaced with either memory_displ

deps: bump iced-x86 from 1.10.3 to 1.11.0

Bumps iced-x86 from 1.10.3 to 1.11.0.

Manual update of the code was needed since memory_displacement() was
deprecated and replaced with either memory_displacement32() or
memory_displacement64().

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>

show more ...


# e22b6ec7 04-Jan-2021 Wei Liu <liuwe@microsoft.com>

hypervisor: x86: emulate MOVS instruction

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


# 21dcac77 14-Dec-2020 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: Bump iced-x86 to 1.10.0

And fix related warnings: op_kind and op_register are being deprecated
as they might panic.

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

hypervisor: Bump iced-x86 to 1.10.0

And fix related warnings: op_kind and op_register are being deprecated
as they might panic.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Rob Bradford <robert.bradford@intel.com>

show more ...


# 93b7dcac 03-Dec-2020 Wei Liu <liuwe@microsoft.com>

hypervisor: emulator: emulate CMP

Unfortunately Rust stable does not yet have inline ASM support the flag
calculation will have to be implemented in software.

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

hypervisor: emulator: emulate CMP

Unfortunately Rust stable does not yet have inline ASM support the flag
calculation will have to be implemented in software.

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

show more ...


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

hypervisor: emulator: drop imm_op macro

It is not needed anymore.

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


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

hypervisor: emulator: introduce get/set_op

Provide two helpers to get and set operands. This reduces repetition.

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


# c352b598 01-Dec-2020 Wei Liu <liuwe@microsoft.com>

hypervisor: emulator: drop InstructionMap

It is not needed anymore.

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


# 15f0451c 30-Nov-2020 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: emulator: Format instructions on error paths

Formatting instructions might be costly, so we only want to do that on
the emulation error paths.

Signed-off-by: Samuel Ortiz <sameo@linux.i

hypervisor: emulator: Format instructions on error paths

Formatting instructions might be costly, so we only want to do that on
the emulation error paths.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.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>


# 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 ...


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

hypervisor: x86: drop an extraneous box indirection

There is no need to put a box into another box.

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 ...


# 0f4f30db 19-Nov-2020 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: x86: Add MOV to the emulator instruction map

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


# fe540122 19-Nov-2020 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: x86: Emulate MOV

And add a few unit tests based on a Mock platform.

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


# 1fc97e91 19-Nov-2020 Samuel Ortiz <sameo@linux.intel.com>

hypervisor: x86: Add an InstructionHandler interface

And an InstructionMap helper structure to map x86 mnemonic codes
to instruction handlers.

Any instruction emulation implementation should then b

hypervisor: x86: Add an InstructionHandler interface

And an InstructionMap helper structure to map x86 mnemonic codes
to instruction handlers.

Any instruction emulation implementation should then boil down with
implementing InstructionHandler for any supported mnemonic.

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

show more ...