Skip to main content

Module config

Module config 

Source
Expand description

Detcore configuration and widely used types.

Re-exports§

pub use crate::canonical_test_epoch::CANONICAL_TEST_EPOCH;
pub use crate::canonical_test_epoch::CANONICAL_TEST_EPOCH_ARG;

Structs§

Config
Configuration options for detcore.
FatalCoreCapture
Where and how much Config::fatal_core_capture may write.
LaunchImage
What a launch tells Detcore about the guest’s first image (Config::launch_image).
MountInfoRootRewrite
One mount row whose kernel-private root must be replaced before it becomes guest-visible.
MountNamespaceIdentity
One mount namespace, as DetConfig::mountinfo_mount_namespace names it.
SignalAt
A signal sent to the run’s root process at a scheduler turn (Config::signal_at).
TimesliceRange
The bounds of --chaos-timeslice-range, in virtual nanoseconds, both included: MIN..MAX, with MIN at least one RCB and no larger than MAX.

Enums§

BlockingMode
How should we handle syscalls which may block, but are internal to the hermit container? These syscalls are determinizable, but there are multiple methods of doing so. These choices do not apply to blocking syscalls that wait for external conditions outside the container, such as network responses.
ChaosTimesliceDraw
How --chaos-timeslice-range draws (--chaos-timeslice-draw).
DetlogAnon
What --detlog-anon records for each anonymous mapping.
ExpiredWaitCharge
How a run of consecutive scheduler turns that each end an expired timed wait is charged while another thread is queued (--expired-wait-charge).
InheritedSeccomp
The seccomp state of the thread that starts the guest, which the guest inherits: every filter that thread has applies to the guest’s system calls, and to the calls Detcore injects into it. Detcore refuses the guest’s own seccomp(2) and prctl(PR_SET_SECCOMP), so these and the backend’s own filter are the only filters a guest has.
ProcLevel
How much of /proc the guest sees (--proc). Each level contains the one before it.
RunsPostFork
Which side of an ordinary fork/clone receives the first post-registration turn.
SchedHeuristic
Apply a specialized scheduling heuristic which may help exercise certain bugs.

Constants§

CONFIG_FINGERPRINT_ENV
N.B. we don’t want to specify two different notions of “default”, so we use the Clap instance above. Environment variable carrying the coordinator’s fingerprint to an out-of-process plugin: detcore::config_wire_fingerprint, which extends config_wire_fingerprint with Detcore’s global RPC definitions.
DEFAULT_BACKEND_CAPABILITIES
The capabilities a Config has before the host prepares it for the backend that runs it: ptrace’s, the backend Detcore’s own tests use, except that eight facts stay off (supports_blocked_wait_signal_interruption and the four split out of it, which set_kernel_signal_facts clears together, delivers_preemption_timer_events, runs_guest_code_between_injections, reports_sigreturns). Until supports_blocked_wait_signal_interruption, delivers_preemption_timer_events and runs_guest_code_between_injections became backend capabilities they were Config fields that only the host set, for the backend it had selected, and were false otherwise; a configuration nobody prepared keeps that behaviour, and the four readings of the first with it. A configuration nobody prepared cannot know that sigreturns are reported, so that is off too (the DBT runtime’s standalone fallback starts from these). reports_kernel_child_exit_signals keeps ptrace’s value, as reports_child_exit_publication does: it took over the child-exit ledger’s gates from that field, so such a configuration behaves as before. The host copies the running backend’s own answer over all of these before a run.
LITEINST_CONFIG_FINGERPRINT_ENV
Environment variable carrying the coordinator’s fingerprint (detcore::config_wire_fingerprint, which extends config_wire_fingerprint with Detcore’s global RPC definitions) to the in-guest LiteInst runtime (libdetcore_liteinst.so), which checks it before it decodes the configuration the coordinator sends. Without the check, a runtime built from another tree fails with a bare decoding error that names neither build (https://github.com/rrnewton/hermit/issues/3986). The runtime removes it once checked, as it removes its DETLOG variables: the value is zeroed in the environment block and the variable is unset, so the fingerprint never reaches the guest.
MAX_SCHEDULER_TURN_COST
The largest --scheduler-turn-cost accepted, in virtual nanoseconds, both before and after the clock multiplier scales it: one second per scheduler turn.
MAX_VIRTUAL_CPUS
The most CPUs --virtual-cpus presents: the bits of the 128-bit mask Detcore’s sched_getaffinity answers with, whose highest CPU is the kernel_max (127) it reports.
RECOMMENDED_CHAOS_TIMESLICE_RANGE
The range used by --chaos-timeslice-draw=run when no range is given. One microsecond to 200 milliseconds spans fine preemption windows and the ordinary maximum. Plain --chaos keeps its fixed maximum: fine draws can cost much more, so this discovery mode remains explicit.

Statics§

DEFAULT_EPOCH_STR
The default epoch used by DetCore for things like initial file modtimes.

Functions§

chaos_long_help
Long help for --chaos, including the explicit discovery mode.
chaos_timeslice_draw_long_help
Long help for the draw policy, sharing the recommended range with resolution.
config_fingerprint_mismatch
What differs when a coordinator announced expected as its config_wire_fingerprint and this build’s is another, or None when they are equal. The in-guest LiteInst runtime reports this before it decodes the coordinator’s configuration (https://github.com/rrnewton/hermit/issues/3986).
config_wire_fingerprint
decode_backend_config_json
Read a legacy configuration or a versioned envelope with exact backend facts.
encode_backend_config_json
Preserve the exact backend facts alongside an already encoded legacy config.
epoch_from_host_time
Convert one invocation’s captured host instant without losing subsecond precision. CLI and comparison orchestration share this input conversion; guest clock progression never reads the host clock through it.
from_legacy_backend_json
Parses JSON written by to_legacy_backend_json, or any JSON in the form a serialized Config had before Config::backend existed, and recovers Config::backend from the fifteen legacy backend keys.
set_kernel_signal_facts
Sets supports_blocked_wait_signal_interruption and the four capabilities Detcore read from it until A5 step 3c.0 split them out (kernel_signal_state_is_guests, kernel_signal_targets_are_predictable, host_task_reads_reach_guest_threads, host_timed_signals_are_physical) to on, together. Every backend has the five equal, so a configuration that set or cleared the one field before the split sets or clears all five with this, and behaves as it did.
to_legacy_backend_json
Serializes config as JSON in the form it had before Config::backend existed.

Type Aliases§

MaybePreemptionTimeoutDeprecated
Deprecated name for an optional PMU-backed virtual-timeslice duration.
MaybeTimeslice
An optional virtual-timeslice duration. None disables that preemption mechanism.