Skip to content

Commit

Permalink
Disable VMP on Fuzz Start (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
novafacing authored May 17, 2024
1 parent 780b162 commit 75d5758
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 0 additions & 2 deletions simics-rs/simics-macro/src/interface/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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(|| {
Expand Down
16 changes: 11 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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)]
Expand Down

0 comments on commit 75d5758

Please sign in to comment.