pub struct SegmentOwner<M: AnyFrameMeta + ?Sized> {
pub perms: Seq<MetaPerm<M>>,
}Expand description
A SegmentOwner<M> holds the permission tokens for all frames in the
Segment<M> for verification purposes.
Fields§
§perms: Seq<MetaPerm<M>>The permissions for all frames in the segment, which must be well-formed and valid.
Implementations§
Source§impl<M: AnyFrameMeta + ?Sized> SegmentOwner<M>
impl<M: AnyFrameMeta + ?Sized> SegmentOwner<M>
Sourcepub proof fn produce_kernel_mem_view(tracked &self, segment: Segment<M>) -> tracked view : MemView
pub proof fn produce_kernel_mem_view(tracked &self, segment: Segment<M>) -> tracked view : MemView
requires
self.inv(),segment.inv_with(self),ensuressegment.kernel_mem_view_covers(&view),Produces a kernel direct-mapping memory view for the segment.
This is a proof bridge from segment ownership to the VM I/O memory-view model. It should eventually be justified by a real frame-content owner instead of metadata permissions alone.
Sourcepub proof fn borrow_kernel_mem_view<'a>(tracked &'a self, segment: Segment<M>) -> tracked view : &'a MemView
pub proof fn borrow_kernel_mem_view<'a>(tracked &'a self, segment: Segment<M>) -> tracked view : &'a MemView
requires
self.inv(),segment.inv_with(self),ensuressegment.kernel_mem_view_covers(view),Borrows a kernel direct-mapping memory view for the segment.
This is the read-side counterpart of Self::produce_kernel_mem_view,
used when the VM I/O owner only needs a shared read view.
Trait Implementations§
Source§impl<M: AnyFrameMeta + ?Sized> Inv for SegmentOwner<M>
impl<M: AnyFrameMeta + ?Sized> Inv for SegmentOwner<M>
Source§open spec fn inv(self) -> bool
open spec fn inv(self) -> bool
{
&&& forall |i: int| {
0 <= i < self.perms.len() as int
==> {
&&& self.perms[i].addr() % PAGE_SIZE == 0
&&& self.perms[i].addr() < MAX_PADDR
&&& self.perms[i].wf(&self.perms[i].inner_perms)
&&& self.perms[i].is_init()
}
}
}The invariant of a Segment:
- the permissions are well-formed and valid;
- the physical addresses of the permissions are aligned and within bounds.
Auto Trait Implementations§
impl<M> Freeze for SegmentOwner<M>
impl<M> !RefUnwindSafe for SegmentOwner<M>
impl<M> Send for SegmentOwner<M>where
M: Send,
impl<M> Sync for SegmentOwner<M>where
M: Sync,
impl<M> Unpin for SegmentOwner<M>where
M: Unpin,
impl<M> UnsafeUnpin for SegmentOwner<M>
impl<M> UnwindSafe for SegmentOwner<M>where
M: UnwindSafe,
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