pub struct NodeOwner<C: PageTableConfig> {
pub meta_own: PageMetaOwner,
pub frame_permission: FracMetadataPerm,
pub children_perm: PointsTo<C::E, NR_ENTRIES>,
pub tree_level: int,
pub slot_index: int,
}Expand description
§Verification Design
The owner type for a page table node. It contains:
meta_own, aPageMetaOwner, which holds the permissions for node-specific metadata fields,nr_childrenandstraychildren_permis an array permission for the underlying frame in which the node is allocated, interpreted as an array ofNR_ENTRIESpage table entriesslot_indexidentifies the underlying frame’s index in the metadata region- Each node is a page table with a level between 1 and 4 (on x86);
leveltracks the level of this node. tree_levelis the level field of theghost_tree::TreeNodethat carries this object. Carried here for convenience, though it can be computed fromlevel.
Fields§
§meta_own: PageMetaOwner§frame_permission: FracMetadataPerm§children_perm: PointsTo<C::E, NR_ENTRIES>§tree_level: int§slot_index: intImplementations§
Source§impl<C: PageTableConfig> NodeOwner<C>
impl<C: PageTableConfig> NodeOwner<C>
Sourcepub proof fn tracked_borrow_frame_metadata_perm(
tracked permission: &FracMetadataPerm,
) -> tracked res : &MetadataPerm
pub proof fn tracked_borrow_frame_metadata_perm( tracked permission: &FracMetadataPerm, ) -> tracked res : &MetadataPerm
*res == permission.resource(),Sourcepub proof fn tracked_borrow_metadata_perm(tracked &self) -> tracked &MetadataPerm
pub proof fn tracked_borrow_metadata_perm(tracked &self) -> tracked &MetadataPerm
self.frame_permission.resource(),Sourcepub open spec fn slot_vaddr(self) -> Vaddr
pub open spec fn slot_vaddr(self) -> Vaddr
{ index_to_meta(self.slot_index) }The meta address of this node’s slot, computed from slot_index.
Sourcepub open spec fn meta_wf(self, regions: MetaRegionOwners) -> bool
pub open spec fn meta_wf(self, regions: MetaRegionOwners) -> bool
{
typed_meta_wf::<
PageTablePageMeta<C>,
>(*regions.slots[self.slot_index], self.frame_permission.resource(), ())
}Sourcepub open spec fn meta_value(self) -> PageTablePageMeta<C>
pub open spec fn meta_value(self) -> PageTablePageMeta<C>
{ typed_meta_value::<PageTablePageMeta<C>>(self.frame_permission.resource(), ()) }Sourcepub open spec fn level(self) -> PagingLevel
pub open spec fn level(self) -> PagingLevel
{ self.meta_value().level }Sourcepub open spec fn metaregion_sound_node(self, regions: MetaRegionOwners) -> bool
pub open spec fn metaregion_sound_node(self, regions: MetaRegionOwners) -> bool
{
let idx = self.slot_index;
&&& regions.contains(idx)
&&& self.frame_permission.id() == regions.slot_owners[idx].metadata_perm.id()
&&& self.meta_wf(regions)
&&& self.meta_value().wf(self.meta_own)
&&& self.meta_own.nr_children.id() == self.meta_value().nr_children.id()
&&& regions.slot_owners[self.slot_index].usage is PageTable
&&& self.count_consistent()
}Regions-tied invariants that used to live in NodeOwner::inv() via
the now-removed meta_perm field. Establishes the bridge between
the NodeOwner and the slot perm parked in regions.
Sourcepub open spec fn count_consistent(self) -> bool
pub open spec fn count_consistent(self) -> bool
{ self.meta_own.nr_children.value() == count_present(self.children_perm.value()) }nr_children equals the number of present PTEs in children_perm.
Held by a settled node (see metaregion_sound_node’s use site).
Source§impl<C: PageTableConfig> NodeOwner<C>
impl<C: PageTableConfig> NodeOwner<C>
Sourcepub proof fn nr_children_absent_slot_bound(self, idx: usize)
pub proof fn nr_children_absent_slot_bound(self, idx: usize)
self.inv(),self.count_consistent(),self.children_perm.value().len() == NR_ENTRIES,idx < NR_ENTRIES,!self.children_perm.value()[idx as int].is_present(),ensuresself.meta_own.nr_children.value() < NR_ENTRIES,If a slot in children_perm holds a non-present PTE, then
nr_children < NR_ENTRIES. Proven (no longer axiomatized) from the
count_consistent invariant: nr_children counts present PTEs, and an
absent slot means not all NR_ENTRIES slots are present.
Sourcepub proof fn nr_children_present_slot_bound(self, idx: usize)
pub proof fn nr_children_present_slot_bound(self, idx: usize)
self.inv(),self.count_consistent(),self.children_perm.value().len() == NR_ENTRIES,idx < NR_ENTRIES,self.children_perm.value()[idx as int].is_present(),ensuresself.meta_own.nr_children.value() > 0,If a slot in children_perm holds a present PTE, then nr_children > 0.
Dual of Self::nr_children_absent_slot_bound; proven from
count_consistent.
Source§impl<'rcu, C: PageTableConfig> NodeOwner<C>
impl<'rcu, C: PageTableConfig> NodeOwner<C>
Sourcepub open spec fn relate_guard(self, guard: PageTableGuard<'rcu, C>) -> bool
pub open spec fn relate_guard(self, guard: PageTableGuard<'rcu, C>) -> bool
{
&&& guard.inner.inner@.ptr.addr() == self.slot_vaddr()
&&& guard.inner.inner@.wf(self)
&&& guard.inner.inner@.external_meta_wf(self.frame_permission.resource(), ())
}Trait Implementations§
Source§impl<C: PageTableConfig> Inv for NodeOwner<C>
impl<C: PageTableConfig> Inv for NodeOwner<C>
Source§open spec fn inv(self) -> bool
open spec fn inv(self) -> bool
{
&&& self.meta_own.inv()
&&& self.frame_permission.frac() == 1
&&& 0 <= self.meta_own.nr_children.value() <= NR_ENTRIES
&&& 1 <= self.level() <= NR_LEVELS
&&& self.children_perm.wf()
&&& self.children_perm.is_init_all()
&&& self.children_perm.addr()
== paddr_to_vaddr(meta_to_frame(index_to_meta(self.slot_index)))
&&& self.tree_level == INC_LEVELS - self.level() - 1
&&& 0 <= self.slot_index < max_meta_slots()
&&& FRAME_METADATA_RANGE.start <= index_to_meta(self.slot_index)
< FRAME_METADATA_RANGE.end
&&& index_to_meta(self.slot_index) % META_SLOT_SIZE == 0
&&& meta_to_frame(index_to_meta(self.slot_index))
< VMALLOC_BASE_VADDR - LINEAR_MAPPING_BASE_VADDR
&&& meta_to_frame(index_to_meta(self.slot_index)) < MAX_PADDR
&&& meta_to_frame(index_to_meta(self.slot_index)) == self.children_perm.addr()
}Auto Trait Implementations§
impl<C> !RefUnwindSafe for NodeOwner<C>
impl<C> Freeze for NodeOwner<C>
impl<C> Send for NodeOwner<C>
impl<C> Sync for NodeOwner<C>
impl<C> Unpin for NodeOwner<C>
impl<C> UnsafeUnpin for NodeOwner<C>
impl<C> UnwindSafe for NodeOwner<C>
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: From<T>,
impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: From<T>,
fn obeys_from_spec() -> bool
fn from_spec(v: T) -> VERUS_SPEC__A
§impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: Into<T>,
impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: Into<T>,
fn obeys_into_spec() -> bool
fn into_spec(self) -> T
§impl<T, U> IntoSpecImpl<U> for Twhere
U: From<T>,
impl<T, U> IntoSpecImpl<U> for Twhere
U: From<T>,
fn obeys_into_spec() -> bool
fn into_spec(self) -> U
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<A> SpecEq<&A> for Awhere
A: ?Sized,
impl<A> SpecEq<&mut A> for Awhere
A: ?Sized,
impl<A> SpecEq<A> for Awhere
A: ?Sized,
impl<A> SpecEq<Ghost<A>> for A
impl<A> SpecEq<Tracked<A>> for A
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.