CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
Loading...
Searching...
No Matches
Revocation::BitmapDirect< WordT, TCMBaseAddr > Class Template Reference

Class for interacting with the shadow bitmap. More...

#include <bitmap_direct.hh>

Inheritance diagram for Revocation::BitmapDirect< WordT, TCMBaseAddr >:

Public Member Functions

void mark_set_one (CHERI::Capability< void > cap)
 Set a single shadow bit for an address.
void mark_clear_one (ptraddr_t address)
 Clear a single shadow bit for an address.
void mark_set_range (CHERI::Capability< void > cap)
 Set a range of shadow bits, from cap's base to its top.
void mark_clear_range (ptraddr_t base, ptraddr_t top)
 Clear a range of shadow bits, from base to top.
bool mark_get (size_t addr)

Protected Member Functions

void init ()
 Initialise this class with a capability to the shadow bitmap.
void mark_one (ptraddr_t address, bool fill)
 Set or clear the single shadow bit for an address.
template<bool Fill>
void mark_range (ptraddr_t base, ptraddr_t top)
 Set or clear the shadow bits for all addresses within [base, top).

Static Protected Member Functions

static constexpr size_t shadow_offset_bits (ptraddr_t addr)
static constexpr size_t shadow_word_index (size_t offsetBits)
static constexpr WordT shadow_mask_bits_below_address (ptraddr_t addr)
static constexpr WordT shadow_mask_bits_above_address (ptraddr_t addr)

Detailed Description

template<typename WordT, ptraddr_t TCMBaseAddr>
class Revocation::BitmapDirect< WordT, TCMBaseAddr >

Class for interacting with the shadow bitmap.

This bitmap controls the behaviour of a hardware load barrier, which will invalidate capabilities in the register file if they point revoked memory. Only memory that is intended for use as a heap is required to use the load barrier and so the revocation bitmap is not required to span the whole of the address space.

Template arguments are the size of the value to be used for reads and updates, which may vary depending on the width of the interface to the shadow memory, and the base address of the memory covered by the shadow bitmap.

This currently assumes that all revocable memory is in a single contiguous region.

Definition at line 31 of file bitmap_direct.hh.

Member Function Documentation

◆ init()

template<typename WordT, ptraddr_t TCMBaseAddr>
void Revocation::BitmapDirect< WordT, TCMBaseAddr >::init ( )
inlineprotected

Initialise this class with a capability to the shadow bitmap.

Definition at line 51 of file bitmap_direct.hh.

References MMIO_CAPABILITY.

Referenced by Ibex::HardwareRevoker< WordT, TCMBaseAddr >::init().

◆ mark_clear_one()

template<typename WordT, ptraddr_t TCMBaseAddr>
void Revocation::BitmapDirect< WordT, TCMBaseAddr >::mark_clear_one ( ptraddr_t address)
inline

Clear a single shadow bit for an address.

Definition at line 215 of file bitmap_direct.hh.

References mark_one().

◆ mark_clear_range()

template<typename WordT, ptraddr_t TCMBaseAddr>
void Revocation::BitmapDirect< WordT, TCMBaseAddr >::mark_clear_range ( ptraddr_t base,
ptraddr_t top )
inline

Clear a range of shadow bits, from base to top.

This takes a pair of addresses rather than a capability since a precisely-bounded capability to the region in question would not be round-trippable through memory, even if the allocator could construct such a thing (since it retains elevated access to the heap region).

Definition at line 237 of file bitmap_direct.hh.

References mark_range().

◆ mark_get()

template<typename WordT, ptraddr_t TCMBaseAddr>
bool Revocation::BitmapDirect< WordT, TCMBaseAddr >::mark_get ( size_t addr)
inline

Definition at line 243 of file bitmap_direct.hh.

◆ mark_one()

template<typename WordT, ptraddr_t TCMBaseAddr>
void Revocation::BitmapDirect< WordT, TCMBaseAddr >::mark_one ( ptraddr_t address,
bool fill )
inlineprotected

Set or clear the single shadow bit for an address.

Parameters
filltrue to set, false to clear the bit

Definition at line 94 of file bitmap_direct.hh.

Referenced by mark_clear_one(), and mark_set_one().

◆ mark_range()

template<typename WordT, ptraddr_t TCMBaseAddr>
template<bool Fill>
void Revocation::BitmapDirect< WordT, TCMBaseAddr >::mark_range ( ptraddr_t base,
ptraddr_t top )
inlineprotected

Set or clear the shadow bits for all addresses within [base, top).

Parameters
Filltrue to set, false to clear the bits

Definition at line 124 of file bitmap_direct.hh.

Referenced by mark_clear_range(), and mark_set_range().

◆ mark_set_one()

template<typename WordT, ptraddr_t TCMBaseAddr>
void Revocation::BitmapDirect< WordT, TCMBaseAddr >::mark_set_one ( CHERI::Capability< void > cap)
inline

Set a single shadow bit for an address.

Definition at line 207 of file bitmap_direct.hh.

References CHERI::Capability< T, IsSealedT >::address(), and mark_one().

◆ mark_set_range()

template<typename WordT, ptraddr_t TCMBaseAddr>
void Revocation::BitmapDirect< WordT, TCMBaseAddr >::mark_set_range ( CHERI::Capability< void > cap)
inline

Set a range of shadow bits, from cap's base to its top.

Definition at line 223 of file bitmap_direct.hh.

References CHERI::Capability< T, IsSealedT >::base(), mark_range(), and CHERI::Capability< T, IsSealedT >::top().

◆ shadow_mask_bits_above_address()

template<typename WordT, ptraddr_t TCMBaseAddr>
constexpr WordT Revocation::BitmapDirect< WordT, TCMBaseAddr >::shadow_mask_bits_above_address ( ptraddr_t addr)
inlinestaticconstexprprotected

Definition at line 72 of file bitmap_direct.hh.

◆ shadow_mask_bits_below_address()

template<typename WordT, ptraddr_t TCMBaseAddr>
constexpr WordT Revocation::BitmapDirect< WordT, TCMBaseAddr >::shadow_mask_bits_below_address ( ptraddr_t addr)
inlinestaticconstexprprotected

Definition at line 66 of file bitmap_direct.hh.

◆ shadow_offset_bits()

template<typename WordT, ptraddr_t TCMBaseAddr>
constexpr size_t Revocation::BitmapDirect< WordT, TCMBaseAddr >::shadow_offset_bits ( ptraddr_t addr)
inlinestaticconstexprprotected

Definition at line 56 of file bitmap_direct.hh.

◆ shadow_word_index()

template<typename WordT, ptraddr_t TCMBaseAddr>
constexpr size_t Revocation::BitmapDirect< WordT, TCMBaseAddr >::shadow_word_index ( size_t offsetBits)
inlinestaticconstexprprotected

Definition at line 61 of file bitmap_direct.hh.


The documentation for this class was generated from the following file: