From 75d5758bd12dedf9edd5a75237bb18d209568e35 Mon Sep 17 00:00:00 2001 From: Rowan Hart Date: Thu, 16 May 2024 17:14:00 -0700 Subject: [PATCH] Disable VMP on Fuzz Start (#88) --- Cargo.toml | 2 +- simics-rs/simics-macro/src/interface/mod.rs | 2 -- src/lib.rs | 16 +++++++++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3fef88e2..77aad659 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ version = "0.2.1" [package.metadata.simics] package-number = 31337 -version = "6.1.1" +version = "6.1.2" [lib] crate-type = ["cdylib", "rlib"] diff --git a/simics-rs/simics-macro/src/interface/mod.rs b/simics-rs/simics-macro/src/interface/mod.rs index 017cfccf..e2bfcdfe 100644 --- a/simics-rs/simics-macro/src/interface/mod.rs +++ b/simics-rs/simics-macro/src/interface/mod.rs @@ -613,7 +613,6 @@ impl CInterface { let simics_base = if let Ok(simics_base) = var("SIMICS_BASE") { PathBuf::from(simics_base) } else { - println!("cargo:warning=No SIMICS_BASE environment variable found, using ispm to find installed packages and using latest base version"); let mut packages = ispm::packages::list(&GlobalOptions::default()) .map_err(|e| Error::custom(format!("Could not get installed packages: {e}")))?; packages.sort(); @@ -627,7 +626,6 @@ impl CInterface { "No SIMICS_BASE variable set and did not find a package with package number 1000" )); }; - println!("cargo:warning=Using Simics base version {}", base.version); base.paths .first() .ok_or_else(|| { diff --git a/src/lib.rs b/src/lib.rs index 4846b72a..f0378a87 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -46,11 +46,11 @@ use serde::{Deserialize, Serialize}; use serde_json::to_writer; use simics::{ break_simulation, class, debug, error, free_attribute, get_class, get_interface, - get_processor_number, lookup_file, object_clock, run_command, run_python, simics_init, trace, - version_base, AsConfObject, BreakpointId, ClassCreate, ClassObjectsFinalize, ConfObject, - CoreBreakpointMemopHap, CoreExceptionHap, CoreMagicInstructionHap, CoreSimulationStoppedHap, - CpuInstrumentationSubscribeInterface, Event, EventClassFlag, FromConfObject, HapHandle, - Interface, IntoAttrValueDict, + get_processor_number, info, lookup_file, object_clock, run_command, run_python, simics_init, + trace, version_base, warn, AsConfObject, BreakpointId, ClassCreate, ClassObjectsFinalize, + ConfObject, CoreBreakpointMemopHap, CoreExceptionHap, CoreMagicInstructionHap, + CoreSimulationStoppedHap, CpuInstrumentationSubscribeInterface, Event, EventClassFlag, + FromConfObject, HapHandle, Interface, IntoAttrValueDict, }; #[cfg(simics_version_6)] use simics::{ @@ -725,6 +725,12 @@ impl Tsffs { return Ok(()); } + // Disable VMP if it is enabled + info!("Disabling VMP"); + + if let Err(e) = run_command("disable-vmp") { + warn!(self.as_conf_object(), "Failed to disable VMP: {}", e); + } self.log(LogMessage::startup())?; #[cfg(simics_version_7)]