Skip to content
Merged
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
6 changes: 6 additions & 0 deletions Guide/src/user_guide/openvmm/snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@ a host of the profile's generation; and an identical effective CPUID.
OpenVMM computes the effective CPUID, including its own leaves and the bits
it owns, such as the cache topology, so an OpenVMM build that computes it
differently rejects earlier snapshots with `E_CPU_SURFACE`.
These checks all run, even after one of them fails: on restore, the
comparison of the effective CPUID with the snapshot's, then, on every boot,
the check that VP 0 observes it and the check that the backend supports the
profile. Their error thus names every violation of each, leads with the code
of the first that fails, in that order, and goes on with the failures of the
others.

Restore also requires:

Expand Down
16 changes: 2 additions & 14 deletions openvmm/openvmm_core/src/worker/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2026,33 +2026,21 @@ impl InitializedVm {
saved_state.is_some() == restore.is_some(),
"a time ABI restore requires both the saved state and the time ABI restore inputs"
);
let checks_started = std::time::Instant::now();
if let Some(input) = restore {
anyhow::ensure!(
input.cpu_profile.id == profile.id(),
"the partition's CPU profile '{}' is not the snapshot's '{}'",
profile.id(),
input.cpu_profile.id
);
time_abi::check_recorded_cpuid(&effective_cpuid, &input.cpu_profile)?;
}
let recorded_done = std::time::Instant::now();
time_abi::check_presented_cpuid(
time_abi::check_cpu_profile(
partition.as_ref(),
hypervisor,
&profile,
&effective_cpuid,
restore.map(|input| &input.cpu_profile),
)?;
let presented_done = std::time::Instant::now();
time_abi::check_profile_support(partition.as_ref(), hypervisor, &profile)?;
let support_done = std::time::Instant::now();
tracing::info!(
cpu_profile = profile.id(),
recorded_cpuid_us = (recorded_done - checks_started).as_micros() as u64,
presented_cpuid_us = (presented_done - recorded_done).as_micros() as u64,
profile_support_us = (support_done - presented_done).as_micros() as u64,
"time ABI CPU checks passed"
);
let report = time_abi::declare_rates(
partition.as_ref(),
&msrs,
Expand Down
Loading
Loading