Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Added
* Add `Sandbox::recreate()`, which rebuilds a sandbox's VM and memory from a snapshot. It recovers unrecoverable sandboxes and keeps configuration, host functions, and interrupt handles by @ludfjig in https://github.com/hyperlight-dev/hyperlight/pull/1751

### Removed
* Remove Git details from build logs. These were not shipped on crates.io.
* Remove the `print_debug` feature and `hyperlight_host::debug!`. Use `tracing::debug!` instead.

### Fixed
* Fix restore on WHP not rewinding the guest TSC on hosts with `TSC_ADJUST` support.

Expand Down
43 changes: 0 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ miri-tests: (ensure-cargo-nextest) (ensure-nightly-miri)
check:
{{ cargo-cmd }} check {{ target-triple-flag }}
{{ cargo-cmd }} check -p hyperlight-host --features crashdump {{ target-triple-flag }}
{{ cargo-cmd }} check -p hyperlight-host --features print_debug {{ target-triple-flag }}
{{ cargo-cmd }} check -p hyperlight-host --features gdb {{ target-triple-flag }}
{{ cargo-cmd }} check -p hyperlight-host --features trace_guest,mem_profile {{ target-triple-flag }}
{{ cargo-cmd }} check -p hyperlight-host --features hw-interrupts {{ target-triple-flag }}
Expand Down
2 changes: 1 addition & 1 deletion hack/clippy-package-features.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fi
EXCLUDED_FEATURES=("${REQUIRED_FEATURES[@]}")

if [[ -n "${TARGET_TRIPLE}" && "$TARGET_TRIPLE" =~ aarch64 ]] || [[ -z "${TARGET_TRIPLE}" && "$(uname -m)" = "aarch64" ]]; then
EXCLUDED_FEATURES+=("crashdump" "trace_guest" "mem_profile" "hw-interrupts" "gdb" "i686-guest" "nanvix-unstable")
EXCLUDED_FEATURES+=("crashdump" "trace_guest" "mem_profile" "hw-interrupts" "gdb")
fi

# Get all features for the package (excluding default and required features)
Expand Down
2 changes: 1 addition & 1 deletion src/hyperlight_common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true

Check warning on line 7 in src/hyperlight_common/Cargo.toml

View workflow job for this annotation

GitHub Actions / miri (X64) / miri

`package.homepage` is redundant with `package.repository`

Check warning on line 7 in src/hyperlight_common/Cargo.toml

View workflow job for this annotation

GitHub Actions / miri (arm64) / miri

`package.homepage` is redundant with `package.repository`
repository.workspace = true
readme.workspace = true
description = """
Expand Down Expand Up @@ -35,7 +35,7 @@
fuzzing = ["dep:arbitrary"]
trace_guest = []
mem_profile = []
std = ["thiserror/std", "log/std", "tracing/std"]
std = ["thiserror/std", "log/std", "tracing?/std"]

[dev-dependencies]
criterion = "0.8.1"
Expand Down
2 changes: 1 addition & 1 deletion src/hyperlight_guest_bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true

Check warning on line 7 in src/hyperlight_guest_bin/Cargo.toml

View workflow job for this annotation

GitHub Actions / miri (X64) / miri

`package.homepage` is redundant with `package.repository`

Check warning on line 7 in src/hyperlight_guest_bin/Cargo.toml

View workflow job for this annotation

GitHub Actions / miri (arm64) / miri

`package.homepage` is redundant with `package.repository`
repository.workspace = true
readme.workspace = true
description = """
Expand All @@ -15,7 +15,7 @@
[features]
default = ["libc", "macros"]
libc = ["dep:hyperlight-libc"] # compile libc from picolibc
trace_guest = ["hyperlight-common/trace_guest", "hyperlight-guest/trace_guest", "hyperlight-guest-tracing/trace"]
trace_guest = ["hyperlight-guest/trace_guest", "hyperlight-guest-tracing/trace"]
mem_profile = ["hyperlight-common/mem_profile"]
macros = ["dep:hyperlight-guest-macro", "dep:linkme"]

Expand Down
4 changes: 1 addition & 3 deletions src/hyperlight_host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true

Check warning on line 7 in src/hyperlight_host/Cargo.toml

View workflow job for this annotation

GitHub Actions / miri (X64) / miri

`package.homepage` is redundant with `package.repository`

Check warning on line 7 in src/hyperlight_host/Cargo.toml

View workflow job for this annotation

GitHub Actions / miri (arm64) / miri

`package.homepage` is redundant with `package.repository`
repository.workspace = true
readme.workspace = true
description = """
Expand Down Expand Up @@ -122,16 +122,14 @@
[build-dependencies]
anyhow = { version = "1.0.102" }
cfg_aliases = "0.2.1"
built = { version = "0.8.1", optional = true, features = ["chrono", "git2"] }
built = { version = "0.8.1", optional = true, features = ["chrono"] }
bindgen = { version = "0.73", features = ["prettyplease"] }
cc = "1.2"

[features]
default = ["kvm", "mshv3", "hvf", "build-metadata"]
function_call_metrics = []
executable_heap = []
# This feature enables printing of debug information to stdout in debug builds
print_debug = []
# Dumps the VM state to a file on unexpected errors or crashes. The path of the file will be printed on stdout and logged.
crashdump = ["dep:chrono", "dep:elfcore"]
trace_guest = ["dep:opentelemetry", "dep:tracing-opentelemetry", "dep:hyperlight-guest-tracing", "hyperlight-common/trace_guest"]
Expand Down
2 changes: 0 additions & 2 deletions src/hyperlight_host/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ fn main() -> Result<()> {
mshv3: { all(feature = "mshv3", target_os = "linux") },
hvf: { all(feature = "hvf", target_os = "macos") },
crashdump: { all(feature = "crashdump", target_arch = "x86_64") },
// print_debug feature is aliased with debug_assertions to make it only available in debug-builds.
print_debug: { all(feature = "print_debug", debug_assertions) },
// the gdb feature (only temporarily!) needs to use
// writable/un-shared snapshot memories.
unshared_snapshot_mem: { gdb },
Expand Down
40 changes: 0 additions & 40 deletions src/hyperlight_host/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,6 @@ macro_rules! log_then_return {
};
}

/// Same as tracing::debug!, but will additionally print to stdout if the print_debug feature is enabled
#[macro_export]
macro_rules! debug {
($($arg:tt)+) =>
{
#[cfg(print_debug)]
println!($($arg)+);
tracing::debug!($($arg)+);
}
}

// LOG_ONCE is used to log information about the crate version once
#[cfg(feature = "build-metadata")]
static LOG_ONCE: Once = Once::new();
Expand All @@ -168,34 +157,5 @@ pub(crate) fn log_build_details() {
"" => info!("Not built on a CI platform"),
other => info!("Built on : {}", other),
}
match built_info::GIT_COMMIT_HASH.unwrap_or("") {
"" => info!("No git commit hash found"),
other => info!("Git commit hash: {}", other),
}

let git = match built_info::GIT_HEAD_REF.unwrap_or("") {
"" => {
info!("No git head ref found");
false
}
other => {
info!("Git head ref: {}", other);
true
}
};
match built_info::GIT_VERSION.unwrap_or("") {
"" => info!("No git version found"),
other => info!("Git version: {}", other),
}
match built_info::GIT_DIRTY.unwrap_or(false) {
true => info!("Repo had uncommitted changes"),
false => {
if git {
info!("Repo had no uncommitted changes")
} else {
info!("No git repo found")
}
}
}
});
}
2 changes: 1 addition & 1 deletion src/hyperlight_host/src/sandbox/trace/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ impl TraceContext {

pub(crate) fn setup_guest_trace(&mut self, ctx: Context) {
if self.start_instant.is_none() {
crate::debug!("Guest Start Epoch set");
tracing::debug!("Guest Start Epoch set");
self.start_wall = Some(SystemTime::now());
self.start_tsc = Some(hyperlight_guest_tracing::invariant_tsc::read_tsc());
self.start_instant = Some(std::time::Instant::now());
Expand Down
2 changes: 1 addition & 1 deletion src/hyperlight_host/src/sandbox/uninitialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl UninitializedSandbox {
pending_file_mappings: Vec::new(),
};

crate::debug!("Sandbox created: {:#?}", sandbox);
tracing::debug!("Sandbox created: {:#?}", sandbox);

Ok(sandbox)
}
Expand Down
3 changes: 0 additions & 3 deletions src/hyperlight_libc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true

Check warning on line 8 in src/hyperlight_libc/Cargo.toml

View workflow job for this annotation

GitHub Actions / miri (X64) / miri

`package.homepage` is redundant with `package.repository`

Check warning on line 8 in src/hyperlight_libc/Cargo.toml

View workflow job for this annotation

GitHub Actions / miri (arm64) / miri

`package.homepage` is redundant with `package.repository`
repository.workspace = true
readme = "README.md"
description = """
Expand All @@ -13,9 +13,6 @@
It builds the picolibc library and generates bindings to the libc types and functions.
"""

[features]
default = []

[dependencies]

[lints]
Expand Down
2 changes: 1 addition & 1 deletion src/tests/rust_guests/dummyguest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ hyperlight-common = { path = "../../../hyperlight_common", default-features = fa
[features]
default = []
trace_guest = ["hyperlight-guest-bin/trace_guest"]
mem_profile = ["hyperlight-common/mem_profile", "hyperlight-guest-bin/mem_profile"]
mem_profile = ["hyperlight-guest-bin/mem_profile"]
4 changes: 2 additions & 2 deletions src/tests/rust_guests/simpleguest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ tracing = { version = "0.1.41", default-features = false, features = ["log", "at

[features]
default = []
trace_guest = ["hyperlight-guest-bin/trace_guest", "hyperlight-guest/trace_guest", "hyperlight-guest-tracing/trace"]
mem_profile = ["hyperlight-common/mem_profile", "hyperlight-guest-bin/mem_profile"]
trace_guest = ["hyperlight-guest-bin/trace_guest"]
mem_profile = ["hyperlight-guest-bin/mem_profile"]

4 changes: 2 additions & 2 deletions src/tests/rust_guests/witguest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ spin = "0.12.0"

[features]
default = []
trace_guest = ["hyperlight-guest-bin/trace_guest", "hyperlight-guest/trace_guest"]
mem_profile = ["hyperlight-common/mem_profile", "hyperlight-guest-bin/mem_profile"]
trace_guest = ["hyperlight-guest-bin/trace_guest"]
mem_profile = ["hyperlight-guest-bin/mem_profile"]
Loading