class Vmo
Defined at line 41 of file ../../zircon/system/utest/core/pager/userpager.h
This class is thread-safe and operations may be called concurrently, from the main test thread
and from additional instances of TestThread that the main thread spawns.
Some member functions will serialize behind a mutex, so callers should take care that this is
expected behavior. At the time of writing this comment, this was the case.
- Some tests call these functions only from the main test thread, in which case the lock is
essentially a no-op.
- Some tests that spawn TestThread instances are already serialized due to tight
synchronization between blocking on page requests and resolving them.
- Other tests that expect concurrent execution do not care about a particular order in
which threads run, so it does not matter whether they were serialized behind a userspace lock
(this mutex) or a lock in the kernel.
Public Methods
void ~Vmo ()
Defined at line 43 of file ../../zircon/system/utest/core/pager/userpager.h
std::unique_ptr<Vmo> Create (zx::vmo vmo, uint64_t size, uint64_t key)
Defined at line 50 of file ../../zircon/system/utest/core/pager/userpager.h
bool Resize (uint64_t new_page_count)
Resizes the vmo.
Defined at line 90 of file ../../zircon/system/utest/core/pager/userpager.cc
void GenerateBufferContents (void * dest_buffer, uint64_t page_count, uint64_t paged_vmo_page_offset)
Generates this vmo contents at the specified offset.
Defined at line 134 of file ../../zircon/system/utest/core/pager/userpager.cc
bool CheckVmar (uint64_t page_offset, uint64_t page_count, const void * expected)
Validates this vmo's content in the specified pages using a mapped vmar.
Defined at line 30 of file ../../zircon/system/utest/core/pager/userpager.cc
bool CheckVmo (uint64_t page_offset, uint64_t page_count, const void * expected)
Validates this vmo's content in the specified pages using vmo_read.
Defined at line 54 of file ../../zircon/system/utest/core/pager/userpager.cc
bool Commit (uint64_t page_offset, uint64_t page_count)
Commits the specified pages in this vmo.
Defined at line 78 of file ../../zircon/system/utest/core/pager/userpager.h
bool Prefetch (uint64_t page_offset, uint64_t page_count)
Defined at line 82 of file ../../zircon/system/utest/core/pager/userpager.h
std::unique_ptr<Vmo> Clone (uint32_t options)
Defined at line 86 of file ../../zircon/system/utest/core/pager/userpager.h
std::unique_ptr<Vmo> Clone (uint64_t offset, uint64_t size, uint32_t options, uint32_t map_perms)
Defined at line 93 of file ../../zircon/system/utest/core/pager/userpager.h
uint64_t size ()
Defined at line 112 of file ../../zircon/system/utest/core/pager/userpager.h
uintptr_t base_addr ()
Defined at line 116 of file ../../zircon/system/utest/core/pager/userpager.h
const zx::vmo & vmo ()
Defined at line 120 of file ../../zircon/system/utest/core/pager/userpager.h
uint64_t key ()
Defined at line 121 of file ../../zircon/system/utest/core/pager/userpager.h
void SetPageFaultSupplyLimit (uint64_t pages_limit)
Set the limit of the range that may be automatically supplied to this VMO from the
UserPager::StartTaggedPageFaultHandler thread. Changing this limit is intended to allow for
tests that will re-inspect supplied regions and want to be resilient against eviction, but do
not want the page fault handler from spuriously succeeding the test by accidentally handling
requests it is not supposed to. To ensure a lack of races this method must be called *before*
initially supplying the range that you then want to have auto supplied.
Defined at line 129 of file ../../zircon/system/utest/core/pager/userpager.h
uint64_t GetPageFaultSupplyLimit ()
Retrieve the current page fault supply limit in pages.
Defined at line 135 of file ../../zircon/system/utest/core/pager/userpager.h
std::unique_ptr<Vmo> CloneLocked (uint64_t offset, uint64_t size, uint32_t options, uint32_t map_perms)
Defined at line 144 of file ../../zircon/system/utest/core/pager/userpager.cc
size_t PollNumChildren (size_t expected_children)
Defined at line 164 of file ../../zircon/system/utest/core/pager/userpager.cc
bool PollPopulatedBytes (size_t expected_bytes)
Defined at line 178 of file ../../zircon/system/utest/core/pager/userpager.cc