class StubBti

Defined at line 29 of file ../../zircon/kernel/dev/iommu/stub/include/dev/iommu/stub/stub_bti.h

Public Methods

zx::result<fbl::RefPtr<Bti>> Create (fbl::RefPtr<StubIommu> iommu, uint64_t bti_txn_id)

Defined at line 24 of file ../../zircon/kernel/dev/iommu/stub/stub_bti.cc

void StubBti (const StubBti & )

Defined at line 34 of file ../../zircon/kernel/dev/iommu/stub/include/dev/iommu/stub/stub_bti.h

void StubBti (StubBti && )

Defined at line 35 of file ../../zircon/kernel/dev/iommu/stub/include/dev/iommu/stub/stub_bti.h

StubBti & operator= (const StubBti & )

Defined at line 36 of file ../../zircon/kernel/dev/iommu/stub/include/dev/iommu/stub/stub_bti.h

StubBti & operator= (StubBti && )

Defined at line 37 of file ../../zircon/kernel/dev/iommu/stub/include/dev/iommu/stub/stub_bti.h

void ReleaseQuarantine ()

Defined at line 80 of file ../../zircon/kernel/dev/iommu/stub/stub_bti.cc

zx::result<fbl::RefPtr<Pmt>> Map (PinnedVmObject pinned_vmo, uint32_t perms, RequireContiguousMapping req_contig)

Implementation of iommu::Bti

Defined at line 43 of file ../../zircon/kernel/dev/iommu/stub/stub_bti.cc

Lock<SpinLock> & get_collection_lock ()

Defined at line 62 of file ../../zircon/kernel/dev/iommu/stub/include/dev/iommu/stub/stub_bti.h

void PrintQuarantineWarning (BtiPageLeakReason reason, size_t pmt_count, uint64_t page_count)

Right now, we cannot print quarantine warnings with any spinlocks held.

The reasons for this are not the best. The primary reason is that the

Print routine attempts to access the current thread's name via the

ThreadDispatcher, and not the kernel thread object. The thread dispatcher

needs to hold its mutex in order to determine if it is still attached to

its kernel thread, which is where the thread's name storage exists.

Why not simply access the name from the current _kernel_ Thread interface?

Because the name-storage for kernel threads is just a simple char array,

and has no locks to synchronize access to it.

A simple fix for this would be to stop using just a char array for the

name, and switch to using a `fbl::Name` instead which is automatically

protected by a spinlock. Until then, however, we need to avoid holding

any spinlocks when reporting quarantine warnings.

Defined at line 86 of file ../../zircon/kernel/dev/iommu/stub/include/dev/iommu/stub/stub_bti.h

bool is_orphaned ()

Utilities used by our child PMTs to manage orphaned state and OOPS reporting.

Defined at line 92 of file ../../zircon/kernel/dev/iommu/stub/include/dev/iommu/stub/stub_bti.h

size_t quarantined_pmt_count ()

Defined at line 93 of file ../../zircon/kernel/dev/iommu/stub/include/dev/iommu/stub/stub_bti.h

uint64_t quarantined_page_count ()

Defined at line 94 of file ../../zircon/kernel/dev/iommu/stub/include/dev/iommu/stub/stub_bti.h

void OnDispatcherZeroHandles ()

Defined at line 107 of file ../../zircon/kernel/dev/iommu/stub/stub_bti.cc

uint64_t minimum_contiguity ()

The min amt. of contiguous mapping this BTI can guarantee.

Defined at line 145 of file ../../zircon/kernel/dev/iommu/stub/stub_bti.cc

uint64_t aspace_size ()

Defined at line 146 of file ../../zircon/kernel/dev/iommu/stub/stub_bti.cc

uint64_t pmo_count ()

Defined at line 148 of file ../../zircon/kernel/dev/iommu/stub/stub_bti.cc

size_t quarantine_count ()

Defined at line 153 of file ../../zircon/kernel/dev/iommu/stub/stub_bti.cc

bool in_fault_state ()

Indicates that this BTI has encountered a "fault" such as a protocol

violation like a leaked PMT, or a HW translation fault. The BTI will

refuse new pin operations until the driver takes control of its hardware,

and calls ReleaseQuarantine on the BTI to indicate that the fault has been

handled.

Defined at line 158 of file ../../zircon/kernel/dev/iommu/stub/stub_bti.cc

void AddToActiveList (StubPmt & pmt)

Defined at line 163 of file ../../zircon/kernel/dev/iommu/stub/stub_bti.cc

void RemoveFromActiveList (StubPmt & pmt, MoveToQuarantine mtq, ReportLeaks report_leaks)

Note: It is assumed that something at a higher level (eg; at the Dispatcher

level) is holding a reference to our stub PMT. If not, it might be possible

for us to accidentally drop the last PMT reference while we are still inside

of our collection lock, which would be bad as we cannot return the StubPmt

memory to the heap while holding a spinlock.

Defined at line 176 of file ../../zircon/kernel/dev/iommu/stub/stub_bti.cc

Enumerations

enum class MoveToQuarantine
Name Value
No 0
Yes 1

Defined at line 31 of file ../../zircon/kernel/dev/iommu/stub/include/dev/iommu/stub/stub_bti.h

enum class ReportLeaks
Name Value
No 0
Yes 1

Defined at line 32 of file ../../zircon/kernel/dev/iommu/stub/include/dev/iommu/stub/stub_bti.h

Friends

class RefPtr
class StubIommu