class VmObjectPaged
Defined at line 35 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
Per thread state to support restricted mode.
Intentionally kept simple to keep the amount of kernel/thread.h dependencies to a minimum.
Public Members
static const uint32_t kResizable
static const uint32_t kContiguous
static const uint32_t kSlice
static const uint32_t kDiscardable
static const uint32_t kAlwaysPinned
static const uint32_t kReference
static const uint32_t kCanBlockOnPageRequests
Public Methods
Lock<CriticalMutex> * lock ()
Defined at line 46 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
Lock<CriticalMutex> & lock_ref ()
Defined at line 49 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
uint64_t lock_order ()
Defined at line 52 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
VmObject * self_locked ()
Defined at line 54 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
const VmObject * self_locked ()
Defined at line 55 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
uint64_t size_locked ()
Defined at line 85 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
ktl::optional<uint64_t> user_stream_size_locked ()
Queries the user defined stream size, which is distinct from the VMO size. Stream size is
byte-aligned and is not guaranteed to be in the range of the VMO. The lock does not not guard
the user changing the value via a syscall, so multiple calls under the same lock acquisition
can have different results.
Defined at line 95 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
ktl::optional<uint64_t> saturating_stream_size_locked ()
Calculates the minimum of the VMO size and the page-aligned user stream size.
Defined at line 104 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
bool is_contiguous ()
Defined at line 122 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
bool is_resizable ()
Defined at line 123 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
bool is_discardable ()
Defined at line 124 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
bool is_user_pager_backed ()
Defined at line 125 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
bool is_dirty_tracked ()
Defined at line 128 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
void mark_modified_locked ()
Defined at line 129 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
ChildType child_type ()
Defined at line 132 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
bool is_slice ()
Defined at line 144 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
bool is_reference ()
Defined at line 145 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
uint64_t parent_user_id ()
Defined at line 146 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
uint64_t HeapAllocationBytes ()
Defined at line 154 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
uint64_t ReclamationEventCount ()
Defined at line 159 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
AttributionCounts GetAttributedMemoryInRange (uint64_t offset_bytes, uint64_t len_bytes)
Defined at line 165 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
zx_status_t HintRange (uint64_t offset, uint64_t len, EvictionHint hint)
Hint how the specified range is intended to be used, so that the hint can be taken into
consideration when reclaiming pages under memory pressure (if applicable).
Defined at line 170 of file ../../zircon/kernel/vm/vm_object_paged.cc
AttributionCounts GetAttributedMemoryInReferenceOwner ()
Defined at line 171 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
AttributionCounts GetAttributedMemoryRangeInReferenceOwner (uint64_t offset, uint64_t len)
Defined at line 179 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
bool children_cannot_access_pages ()
Does this VMO have any children that can see pages owned by this VMO (i.e. pages held by its
VmCowPages page list).
Defined at line 187 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
zx_status_t CommitRange (uint64_t offset, uint64_t len)
Defined at line 203 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
zx_status_t PrefetchRange (uint64_t offset, uint64_t len)
Defined at line 204 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t CommitRangePinned (uint64_t offset, uint64_t len, bool write)
Defined at line 206 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
zx_status_t ZeroRange (uint64_t offset, uint64_t len)
Defined at line 211 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
zx_status_t ZeroRangeUntracked (uint64_t offset, uint64_t len)
Defined at line 214 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
void Unpin (uint64_t offset, uint64_t len)
Defined at line 223 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
bool DebugIsRangePinned (uint64_t offset, uint64_t len)
See VmObject::DebugIsRangePinned
Defined at line 232 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
bool CanDedupZeroPagesLocked ()
Returns whether or not zero pages can be safely deduped from this VMO. Zero pages cannot be
deduped if the VMO is in use for kernel mappings, or if the pages cannot be accessed from the
physmap due to not being cached.
Defined at line 252 of file ../../zircon/kernel/vm/vm_object_paged.cc
void CommitHighPriorityPages (uint64_t offset, uint64_t len)
Defined at line 241 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t FailPageRequests (uint64_t offset, uint64_t len, zx_status_t error_status)
Defined at line 262 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
zx_status_t QueryPagerVmoStats (bool reset, zx_pager_vmo_stats_t * stats)
Defined at line 274 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
void ResetPagerVmoStats ()
Defined at line 279 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
zx_status_t WritebackBegin (uint64_t offset, uint64_t len, bool is_zero_range)
Defined at line 284 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
zx_status_t WritebackEnd (uint64_t offset, uint64_t len)
Defined at line 291 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
void SetUserStreamSize (fbl::RefPtr<StreamSizeManager> ssm)
See VmObject::SetUserStreamSize
Defined at line 300 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
void Dump (uint depth, bool verbose)
Defined at line 305 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
uint32_t DebugLookupDepth ()
Defined at line 310 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
zx::result<VmCowPages::LookupCursor> GetLookupCursorLocked (uint64_t offset, uint64_t max_len)
Gets a reference to a LookupCursor for the specified range in the VMO. The returned cursor and
all the items returned by the cursor are only valid as long as the lock is contiguous held.
The requested range must be fully inside the VMO, and if a cursor is returned the caller can
assume that all offsets up to |max_len| can be queried. Pages returned by the cursor itself
might be from this VMO or a parent, depending on actual cursor methods used.
See |VmCowPages::LookupCursor|.
Defined at line 326 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
uint32_t GetMappingCachePolicyLocked ()
Defined at line 340 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
void DetachSource ()
Defined at line 345 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
ktl::optional<zx_koid_t> GetPageSourceKoid ()
Defined at line 347 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
zx_status_t Create (uint32_t pmm_alloc_flags, uint32_t options, uint64_t size, fbl::RefPtr<VmObjectPaged> * vmo)
Defined at line 350 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t CreateContiguous (uint32_t pmm_alloc_flags, uint64_t size, uint8_t alignment_log2, fbl::RefPtr<VmObjectPaged> * vmo)
Create a VMO backed by a contiguous range of physical memory. The
returned vmo has all of its pages committed, and does not allow
decommitting them.
Defined at line 360 of file ../../zircon/kernel/vm/vm_object_paged.cc
bool DebugValidatePageSharing ()
This performs a very expensive validation that checks if pages owned by this VMO are shared
correctly with children and is intended as a debugging aid. A return value of false indicates
that the VMO hierarchy is corrupt and the system should probably panic as soon as possible. As
a result, if false is returned this may write various additional information to the debuglog.
Defined at line 370 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
fbl::RefPtr<VmCowPages> DebugGetCowPages ()
Exposed for testing.
Defined at line 376 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
vm_page_t * DebugGetPage (uint64_t offset)
Defined at line 381 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
PriorityChanger MakePriorityChanger (int64_t delta)
See the comments on |PriorityChanger| for how to use this object.
Defined at line 405 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
void MaybeDeadTransition ()
Defined at line 409 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
VmCowPages::DeferredOps MakeDeferredOps ()
Constructs and returns a |DeferredOps| that can be passed into other methods on this VMO that
require one.
Defined at line 413 of file ../../zircon/kernel/vm/include/vm/vm_object_paged.h
zx_status_t CreateFromWiredPages (const void * data, size_t size, bool exclusive, fbl::RefPtr<VmObjectPaged> * vmo)
Creates a VMO from wired pages.
Creating a VMO using this method is destructive. Once the VMO is released, its
pages will be released into the general purpose page pool, so it is not possible
to create multiple VMOs for the same region using this method.
|exclusive| indicates whether or not the created vmo should have exclusive access to
the pages. If exclusive is true, then [data, data + size) will be unmapped from the
kernel address space (unless they lie in the physmap).
Defined at line 430 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t CreateExternal (fbl::RefPtr<PageSource> src, uint32_t options, uint64_t size, fbl::RefPtr<VmObjectPaged> * vmo)
Defined at line 502 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t Resize (uint64_t size)
Defined at line 1252 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t DecommitRange (uint64_t offset, uint64_t len)
Defined at line 1083 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t LockRange (uint64_t offset, uint64_t len, zx_vmo_lock_state_t * lock_state_out)
Defined at line 1952 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t TryLockRange (uint64_t offset, uint64_t len)
Defined at line 1966 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t UnlockRange (uint64_t offset, uint64_t len)
Defined at line 1979 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t Read (void * ptr, uint64_t offset, size_t len)
Defined at line 1426 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t Write (const void * ptr, uint64_t offset, size_t len)
Defined at line 1449 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t Lookup (uint64_t offset, uint64_t len, VmObject::LookupFunction lookup_fn)
Defined at line 1515 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t LookupContiguous (uint64_t offset, uint64_t len, paddr_t * out_paddr)
Defined at line 1534 of file ../../zircon/kernel/vm/vm_object_paged.cc
ktl::pair<zx_status_t, size_t> ReadUser (user_out_ptr<char> ptr, uint64_t offset, size_t len, VmObjectReadWriteOptions options)
Defined at line 1585 of file ../../zircon/kernel/vm/vm_object_paged.cc
ktl::pair<zx_status_t, size_t> WriteUser (user_in_ptr<const char> ptr, uint64_t offset, size_t len, VmObjectReadWriteOptions options, const OnWriteBytesTransferredCallback & on_bytes_transferred)
Defined at line 1602 of file ../../zircon/kernel/vm/vm_object_paged.cc
ktl::pair<zx_status_t, size_t> ReadUserVector (user_out_iovec_t vec, uint64_t offset, size_t len)
Defined at line 1627 of file ../../zircon/kernel/vm/vm_object_paged.cc
ktl::pair<zx_status_t, size_t> WriteUserVector (user_in_iovec_t vec, uint64_t offset, size_t len, const OnWriteBytesTransferredCallback & on_bytes_transferred)
Defined at line 1663 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t TakePages (uint64_t offset, uint64_t len, VmPageSpliceList * pages)
Defined at line 1700 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t SupplyPages (uint64_t offset, uint64_t len, VmPageSpliceList * pages, SupplyOptions options)
Defined at line 1749 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t DirtyPages (uint64_t offset, uint64_t len)
Defined at line 1786 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t EnumerateDirtyRanges (uint64_t offset, uint64_t len, DirtyRangeEnumerateFunction && dirty_range_fn)
Defined at line 1825 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t GetPage (uint64_t offset, uint pf_flags, list_node * alloc_list, MultiPageRequest * page_request, vm_page_t ** page, paddr_t * pa)
Defined at line 1992 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t CreateClone (Resizability resizable, SnapshotType type, uint64_t offset, uint64_t size, bool copy_name, fbl::RefPtr<VmObject> * child_vmo)
Defined at line 731 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t CacheOp (uint64_t offset, uint64_t len, CacheOpType type)
Defined at line 1471 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t SetMappingCachePolicy (uint32_t cache_policy)
Defined at line 1840 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t CreateChildSlice (uint64_t offset, uint64_t size, bool copy_name, fbl::RefPtr<VmObject> * child_vmo)
Defined at line 569 of file ../../zircon/kernel/vm/vm_object_paged.cc
zx_status_t CreateChildReference (Resizability resizable, uint64_t offset, uint64_t size, bool copy_name, bool * first_child, fbl::RefPtr<VmObject> * child_vmo)
Defined at line 617 of file ../../zircon/kernel/vm/vm_object_paged.cc
void RangeChangeUpdateLocked (VmCowRange range, RangeChangeOp op)
Apply the specified operation to all mappings in the given range.
Defined at line 1917 of file ../../zircon/kernel/vm/vm_object_paged.cc
void ForwardRangeChangeUpdateLocked (uint64_t offset, uint64_t len, RangeChangeOp op)
Apply the specified operation to all mappings in the given range, forwarded to the original
owner of the VmCowPages. In the case of references and slices, this ensures that all VMOs in
the reference list of the original, cloned VMO are included.
Defined at line 1941 of file ../../zircon/kernel/vm/vm_object_paged.cc
Friends
class ReferenceListTraits
class RefPtr