Skip to content

Commit 75d5758

Browse files
authored
Disable VMP on Fuzz Start (#88)
1 parent 780b162 commit 75d5758

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ version = "0.2.1"
2121

2222
[package.metadata.simics]
2323
package-number = 31337
24-
version = "6.1.1"
24+
version = "6.1.2"
2525

2626
[lib]
2727
crate-type = ["cdylib", "rlib"]

simics-rs/simics-macro/src/interface/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,6 @@ impl CInterface {
613613
let simics_base = if let Ok(simics_base) = var("SIMICS_BASE") {
614614
PathBuf::from(simics_base)
615615
} else {
616-
println!("cargo:warning=No SIMICS_BASE environment variable found, using ispm to find installed packages and using latest base version");
617616
let mut packages = ispm::packages::list(&GlobalOptions::default())
618617
.map_err(|e| Error::custom(format!("Could not get installed packages: {e}")))?;
619618
packages.sort();
@@ -627,7 +626,6 @@ impl CInterface {
627626
"No SIMICS_BASE variable set and did not find a package with package number 1000"
628627
));
629628
};
630-
println!("cargo:warning=Using Simics base version {}", base.version);
631629
base.paths
632630
.first()
633631
.ok_or_else(|| {

src/lib.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ use serde::{Deserialize, Serialize};
4646
use serde_json::to_writer;
4747
use simics::{
4848
break_simulation, class, debug, error, free_attribute, get_class, get_interface,
49-
get_processor_number, lookup_file, object_clock, run_command, run_python, simics_init, trace,
50-
version_base, AsConfObject, BreakpointId, ClassCreate, ClassObjectsFinalize, ConfObject,
51-
CoreBreakpointMemopHap, CoreExceptionHap, CoreMagicInstructionHap, CoreSimulationStoppedHap,
52-
CpuInstrumentationSubscribeInterface, Event, EventClassFlag, FromConfObject, HapHandle,
53-
Interface, IntoAttrValueDict,
49+
get_processor_number, info, lookup_file, object_clock, run_command, run_python, simics_init,
50+
trace, version_base, warn, AsConfObject, BreakpointId, ClassCreate, ClassObjectsFinalize,
51+
ConfObject, CoreBreakpointMemopHap, CoreExceptionHap, CoreMagicInstructionHap,
52+
CoreSimulationStoppedHap, CpuInstrumentationSubscribeInterface, Event, EventClassFlag,
53+
FromConfObject, HapHandle, Interface, IntoAttrValueDict,
5454
};
5555
#[cfg(simics_version_6)]
5656
use simics::{
@@ -725,6 +725,12 @@ impl Tsffs {
725725
return Ok(());
726726
}
727727

728+
// Disable VMP if it is enabled
729+
info!("Disabling VMP");
730+
731+
if let Err(e) = run_command("disable-vmp") {
732+
warn!(self.as_conf_object(), "Failed to disable VMP: {}", e);
733+
}
728734
self.log(LogMessage::startup())?;
729735

730736
#[cfg(simics_version_7)]

0 commit comments

Comments
 (0)