Skip to main content

Module asm

Module asm 

Source
Expand description

The probe’s measured windows, written in assembly (https://github.com/rrnewton/hermit/issues/4243).

Each arm runs from “every register of every enabled component holds a known value” through “the case’s initializing step” to “XSAVE of every enabled component” inside one assembly function. No compiler-generated code runs in that window, so nothing Rust emits (a memcpy using SSE, say) can change the state being measured. The Rust driver prepares the buffers before a call and reads the certificates (interrupt counter, getrusage, schedstat) outside it.

Structs§

ArmCtx
The state of one arm call, shared with the assembly. Field offsets are fixed by the assembly below; the test arm_ctx_layout_matches_the_assembly checks them.
PeerCtx
The peer thread’s state, shared with the assembly; offsets as noted.

Enums§

ArmStatus
How an arm call ended. Anything but Ok voids the trial.
Kind
The initializing step of a probe case. The numbering is shared with the assembly dispatch below.
Mode
What an arm does after its initializing step and before its XSAVE.
PeerState
The state the peer leaves on the shared CPU before it replies.

Constants§

PEER_EXIT
The handshake byte that ends the peer loop.

Functions§

hermit_xinuse_arm⚠
Runs one arm and returns its ArmStatus. The save area receives the XSAVE image and pkru_out the RDPKRU value.
hermit_xinuse_cpuid_cycles⚠
The TSC cycles of one CPUID leaf 0.
hermit_xinuse_peer_loop⚠
Serves handshakes until it reads PEER_EXIT or a call fails.
hermit_xinuse_save_restore_cycles⚠
The TSC cycles of one plain XSAVE plus standard XRSTOR of xcr0.
hermit_xinuse_syscall_cycles⚠
The TSC cycles of one getppid round trip.