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.
- Fatal
Core Capture - Where and how much
Config::fatal_core_capturemay write. - Launch
Image - What a launch tells Detcore about the guest’s first image
(
Config::launch_image). - Mount
Info Root Rewrite - One mount row whose kernel-private root must be replaced before it becomes guest-visible.
- Mount
Namespace Identity - One mount namespace, as
DetConfig::mountinfo_mount_namespacenames it. - Signal
At - A signal sent to the run’s root process at a scheduler turn
(
Config::signal_at). - Timeslice
Range - The bounds of
--chaos-timeslice-range, in virtual nanoseconds, both included:MIN..MAX, withMINat least one RCB and no larger thanMAX.
Enums§
- Blocking
Mode - 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.
- Chaos
Timeslice Draw - How
--chaos-timeslice-rangedraws (--chaos-timeslice-draw). - Detlog
Anon - What
--detlog-anonrecords for each anonymous mapping. - Expired
Wait Charge - How a run of consecutive scheduler turns that each end an expired timed wait is charged while
another thread is queued (
--expired-wait-charge). - Inherited
Seccomp - 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)andprctl(PR_SET_SECCOMP), so these and the backend’s own filter are the only filters a guest has. - Proc
Level - How much of
/procthe guest sees (--proc). Each level contains the one before it. - Runs
Post Fork - Which side of an ordinary fork/clone receives the first post-registration turn.
- Sched
Heuristic - 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
Clapinstance above. Environment variable carrying the coordinator’s fingerprint to an out-of-process plugin:detcore::config_wire_fingerprint, which extendsconfig_wire_fingerprintwith Detcore’s global RPC definitions. - DEFAULT_
BACKEND_ CAPABILITIES - The capabilities a
Confighas 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_interruptionand the four split out of it, whichset_kernel_signal_factsclears together,delivers_preemption_timer_events,runs_guest_code_between_injections,reports_sigreturns). Untilsupports_blocked_wait_signal_interruption,delivers_preemption_timer_eventsandruns_guest_code_between_injectionsbecame backend capabilities they wereConfigfields 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_signalskeeps ptrace’s value, asreports_child_exit_publicationdoes: 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 extendsconfig_wire_fingerprintwith 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-costaccepted, in virtual nanoseconds, both before and after the clock multiplier scales it: one second per scheduler turn. - MAX_
VIRTUAL_ CPUS - The most CPUs
--virtual-cpuspresents: the bits of the 128-bit mask Detcore’ssched_getaffinityanswers with, whose highest CPU is thekernel_max(127) it reports. - RECOMMENDED_
CHAOS_ TIMESLICE_ RANGE - The range used by
--chaos-timeslice-draw=runwhen no range is given. One microsecond to 200 milliseconds spans fine preemption windows and the ordinary maximum. Plain--chaoskeeps 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
expectedas itsconfig_wire_fingerprintand this build’s is another, orNonewhen 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 serializedConfighad beforeConfig::backendexisted, and recoversConfig::backendfrom the fifteen legacy backend keys. - set_
kernel_ signal_ facts - Sets
supports_blocked_wait_signal_interruptionand 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) toon, 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
configas JSON in the form it had beforeConfig::backendexisted.
Type Aliases§
- Maybe
Preemption Timeout Deprecated - Deprecated name for an optional PMU-backed virtual-timeslice duration.
- Maybe
Timeslice - An optional virtual-timeslice duration.
Nonedisables that preemption mechanism.