pub struct TLBShootdownSource {
pub config: TLBShootdownConfig,
}Expand description
Harvests timing jitter from TLB invalidation broadcasts via mprotect().
§What it measures
Nanosecond timing of mprotect() permission toggles (read-write → read-only
→ read-write) on varying numbers of pages within a pre-allocated memory region.
§Why it’s entropic
When mprotect() changes page protection on a multi-core system, the kernel
must invalidate stale TLB entries on ALL cores:
- Inter-Processor Interrupt (IPI) — the kernel sends an IPI to every core that might have cached TLB entries for the affected pages
- TLB flush latency — each receiving core must drain its pipeline, flush matching TLB entries, and acknowledge
- Cross-cluster latency — Apple Silicon has separate P-core and E-core clusters with different interconnect latencies
- Concurrent IPI traffic — other processes’
mprotect()/munmap()calls create IPI storms that interfere with our measurements
§What makes it unique
TLB shootdowns are a microarchitectural side-channel that has been studied for attacks but never harvested as an entropy source. The IPI broadcast mechanism creates system-wide nondeterminism that depends on the state of EVERY core simultaneously.
§Configuration
See TLBShootdownConfig for tunable parameters. Key options:
measure_variance: delta-of-deltas extraction (recommended:true)page_count_range: controls IPI storm intensityregion_pages: controls physical page diversity
Fields§
§config: TLBShootdownConfigSource configuration. Use Default::default() for recommended settings.
Trait Implementations§
Source§impl Default for TLBShootdownSource
impl Default for TLBShootdownSource
Source§fn default() -> TLBShootdownSource
fn default() -> TLBShootdownSource
Returns the “default value” for a type. Read more
Source§impl EntropySource for TLBShootdownSource
impl EntropySource for TLBShootdownSource
Auto Trait Implementations§
impl Freeze for TLBShootdownSource
impl RefUnwindSafe for TLBShootdownSource
impl Send for TLBShootdownSource
impl Sync for TLBShootdownSource
impl Unpin for TLBShootdownSource
impl UnsafeUnpin for TLBShootdownSource
impl UnwindSafe for TLBShootdownSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more