pub enum KernelOpValue {
U32(u32),
U64(u64),
Bytes(Vec<u8>),
OrU32(u32),
}Expand description
Wire-encoded crate::scenario::ops::KernelValue variant tag.
Mirrors the four KernelValue enum variants 1:1.
Variants§
U32(u32)
32-bit unsigned, little-endian on the wire and at the
resolved PA. Atomic when the resolved host PA is 4-byte
aligned (see GuestKernel::write_*_u32 doc).
U64(u64)
64-bit unsigned, little-endian. Atomic at 8-byte alignment.
Bytes(Vec<u8>)
Variable-length byte payload. Written non-atomically; the dispatcher emits a Release fence after the copy.
OrU32(u32)
32-bit unsigned read-modify-write OR mask. The cold-path
dispatcher reads the live u32 at the resolved host PA,
ORs the carried mask into it, and writes the new value
back as two separate read_u32 / write_u32 calls —
atomic by quiesce because the freeze rendezvous parks
every guest vCPU before the RMW runs (no concurrent
kernel writer can interleave). No compare_exchange loop
in the cold path. Mirrors
crate::scenario::ops::KernelValue::OrU32 — see that
variant’s doc for the full atomicity, ordering, and
width-correctness contract (the canonical
SCX_RQ_CLK_VALID use case + the
kernel/sched/sched.h:802 u32-width citation for the
struct scx_rq.flags field that motivated keeping the
variant u32 rather than u64). Hot-path support is a
future variant — it would require AtomicU32::from_ptr
- cmpxchg + strict alignment rejection.
Trait Implementations§
Source§impl Clone for KernelOpValue
impl Clone for KernelOpValue
Source§fn clone(&self) -> KernelOpValue
fn clone(&self) -> KernelOpValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KernelOpValue
impl Debug for KernelOpValue
Source§impl<'de> Deserialize<'de> for KernelOpValue
impl<'de> Deserialize<'de> for KernelOpValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&KernelValue> for KernelOpValue
impl From<&KernelValue> for KernelOpValue
Source§fn from(value: &KernelValue) -> Self
fn from(value: &KernelValue) -> Self
1:1 mapping of every Op-side KernelValue variant to its
wire-side peer. The Bytes arm clones the inner Vec<u8>
so the source variant remains usable after dispatch (large
payloads pay the clone cost — see
crate::vmm::wire::KernelOpValue::Bytes for the wire
representation).
Source§impl From<&KernelValueWidth> for KernelOpValue
impl From<&KernelValueWidth> for KernelOpValue
Source§fn from(width: &KernelValueWidth) -> Self
fn from(width: &KernelValueWidth) -> Self
Map a KernelValueWidth to a zero-filled
crate::vmm::wire::KernelOpValue of the requested width
for the read-entry’s value-hint slot. The wire payload’s
value discriminant tells the host dispatcher which read
family to invoke; the byte contents are written by the
host before replying.
Source§impl PartialEq for KernelOpValue
impl PartialEq for KernelOpValue
Source§impl Serialize for KernelOpValue
impl Serialize for KernelOpValue
impl Eq for KernelOpValue
impl StructuralPartialEq for KernelOpValue
Auto Trait Implementations§
impl Freeze for KernelOpValue
impl RefUnwindSafe for KernelOpValue
impl Send for KernelOpValue
impl Sync for KernelOpValue
impl Unpin for KernelOpValue
impl UnwindSafe for KernelOpValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more