mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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>
This commit is contained in:
@@ -140,16 +140,3 @@ pub trait InstructionHandler<T: CpuStateManager> {
|
||||
platform: &mut dyn PlatformEmulator<CpuState = T>,
|
||||
) -> Result<(), EmulationError<Exception>>;
|
||||
}
|
||||
|
||||
macro_rules! insn_format {
|
||||
($insn:ident) => {{
|
||||
let mut output = String::new();
|
||||
let mut formatter = FastFormatter::new();
|
||||
formatter
|
||||
.options_mut()
|
||||
.set_space_after_operand_separator(true);
|
||||
formatter.format(&$insn, &mut output);
|
||||
|
||||
output
|
||||
}};
|
||||
}
|
||||
|
||||
@@ -599,8 +599,8 @@ impl<T: CpuStateManager> Emulator<'_, T> {
|
||||
decoder.decode_out(&mut insn);
|
||||
if decoder.last_error() != DecoderError::None {
|
||||
return Err(EmulationError::InstructionFetchingError(anyhow!(
|
||||
"{:#x?}",
|
||||
insn_format!(insn)
|
||||
"{:?}",
|
||||
insn.code()
|
||||
)));
|
||||
}
|
||||
}
|
||||
@@ -609,14 +609,17 @@ impl<T: CpuStateManager> Emulator<'_, T> {
|
||||
Emulator::get_handler(insn.code())
|
||||
.ok_or_else(|| {
|
||||
EmulationError::UnsupportedInstruction(anyhow!(
|
||||
"{:#x?} {:?} {:?}",
|
||||
insn_format!(insn),
|
||||
insn.mnemonic(),
|
||||
insn.code()
|
||||
"{:?} {:x?}",
|
||||
insn.code(),
|
||||
insn_stream
|
||||
))
|
||||
})?
|
||||
.emulate(&insn, &mut state, self.platform)
|
||||
.context(anyhow!("Failed to emulate {:#x?}", insn_format!(insn)))?;
|
||||
.context(anyhow!(
|
||||
"Failed to emulate {:?} {:x?}",
|
||||
insn.code(),
|
||||
insn_stream
|
||||
))?;
|
||||
|
||||
last_decoded_ip = decoder.ip();
|
||||
num_insn_emulated += 1;
|
||||
|
||||
Reference in New Issue
Block a user