Skip to content

TLB

struct tlb_payload (2 fields) source
§ enum tlb_payload_type type
§ union
§ vaddr_t addr
§ struct
§ size_t stride
struct tlb_request (3 fields) source
§ enum tlb_mode mode
§ struct cpu_mask targets
§ struct tlb_payload payload
enum tlb_payload_type (3 variants) source

A type describes what an actual operation is

§ TLB_PAYLOAD_PAGE

Invalidate just this one page

§ TLB_PAYLOAD_RANGE

Invalidate this range

§ TLB_PAYLOAD_FLUSH

Completely flush everything

enum tlb_mode (4 variants) source

Modes specify how to deliver. SYNC and ASYNC are eager

§ TLB_MODE_SYNC

Send the IPI out, wait for responses

§ TLB_MODE_ASYNC

Fire and forget

§ TLB_MODE_LAZY

Tell the other CPUs about it, but no enqueues

§ TLB_MODE_NONE

Local only: no remote CPUs are told (caller batches)

typedef uint64_t tlb_stamp_t
source
void tlb_init(void)
source
enum irq_result tlb_shootdown_isr(struct irq_context *rsp, void *ctx)
source
void tlb_shootdown_full(struct tlb_request rq)
source
void tlb_invalidate_lazy(void)
source
#define TLB_QUEUE_SIZE 64
source

per-cpu

#define tlb_shootdown(...)
source
Expansion
#define tlb_shootdown(...) \
    tlb_shootdown_full(cc_wno_override_init_expr( \
        struct tlb_request, \
        ((struct tlb_request) {.mode = TLB_MODE_SYNC, \
                               .targets = CPU_MASK_INIT_ALL, \
                               .payload.type = TLB_PAYLOAD_PAGE, \
                               ##__VA_ARGS__})))