| /linux/tools/testing/selftests/bpf/libarena/include/libarena/ |
| H A D | bitmap.h | 15 struct arena_bitmap __arena *bmp_alloc(size_t bits); 16 void bmp_free(struct arena_bitmap __arena *bmp); 18 void __bmp_set_bit(u32 bit, struct arena_bitmap __arena *bmp); 19 void __bmp_clear_bit(u32 bit, struct arena_bitmap __arena *bmp); 20 void bmp_set_bit(u32 bit, struct arena_bitmap __arena *bmp); 21 void bmp_clear_bit(u32 bit, struct arena_bitmap __arena *bmp); 22 bool bmp_test_bit(u32 bit, struct arena_bitmap __arena *bmp); 23 bool bmp_test_and_clear_bit(u32 bit, struct arena_bitmap __arena *bmp); 24 bool bmp_test_and_set_bit(u32 bit, struct arena_bitmap __arena *bmp); 26 void bmp_clear(size_t bits, struct arena_bitmap __arena *bmp); [all …]
|
| H A D | common.h | 51 void __arena *arena_malloc(size_t size); 52 void arena_free(void __arena *ptr); 68 #define __arena macro 85 void __arena *arena_base;
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | verifier_arena.c | 33 volatile int __arena *page1, *page2, *no_page; in basic_alloc1_nosleep() 50 bpf_arena_free_pages(&arena, (void __arena *)page2, 1); in basic_alloc1_nosleep() 64 volatile int __arena *page1, *page2, *no_page, *page3; in basic_alloc1() 81 bpf_arena_free_pages(&arena, (void __arena *)page2, 1); in basic_alloc1() 102 void __arena *page1, *page2, *page3; in free_scalar_below_arena() 117 bpf_arena_free_pages(&arena, (void __arena *)bad_addr, 1); in free_scalar_below_arena() 131 volatile char __arena *page1, *page2, *page3, *page4; in basic_alloc2_nosleep() 151 bpf_arena_free_pages(&arena, (void __arena *)page1, 2); in basic_alloc2_nosleep() 169 volatile char __arena *page1, *page2, *page3, *page4; in basic_alloc2() 189 bpf_arena_free_pages(&arena, (void __arena *)page1, 2); in basic_alloc2() [all …]
|
| H A D | verifier_arena_large.c | 25 volatile char __arena *page1, *page2, *no_page, *page3; in big_alloc1() 38 page2 = bpf_arena_alloc_pages(&arena, (void __arena *)(ARENA_SIZE - 2 * PAGE_SIZE), in big_alloc1() 45 no_page = bpf_arena_alloc_pages(&arena, (void __arena *)ARENA_SIZE - PAGE_SIZE, in big_alloc1() 50 no_page = bpf_arena_alloc_pages(&arena, (void __arena *)ARENA_SIZE, in big_alloc1() 58 bpf_arena_free_pages(&arena, (void __arena *)page1, 1); in big_alloc1() 89 volatile char __arena *page; in access_reserved() 90 char __arena *base; in access_reserved() 106 page = (volatile char __arena *)(base + i * PAGE_SIZE); in access_reserved() 128 volatile char __arena *page; in request_partially_reserved() 129 char __arena *bas in request_partially_reserved() [all...] |
| H A D | struct_ops_arena.c | 22 u64 __arena arena_touch; 24 u64 __arena cb_ptr_val; 29 u64 __arena *ptr = (u64 __arena *)ctx[0]; in test_arena_cb() 40 u64 __arena *ptr = (u64 __arena *)ctx[0]; in test_arena_nullable_cb() 52 u64 __arena *ptr = (u64 __arena *)ctx[8]; in test_arena_stack_cb() 65 u64 __arena *ptr = (u64 __arena *)ctx[2]; in test_arena_multislot_cb() 90 u64 __arena *val; in trigger() 136 bpf_arena_free_pages(&arena, (void __arena *)val, 1); in trigger()
|
| H A D | bpf_arena_spin_lock.h | |
| H A D | arena_kfunc.c | 23 u64 __arena arena_pad; 35 u64 __arena *val; in arena_arg_forms() 61 bpf_arena_free_pages(&arena, (void __arena *)val, 1); in arena_arg_forms() 79 u64 __arena *val; in arena_arg_rebase() 109 bpf_arena_free_pages(&arena, (void __arena *)val, 1); in arena_arg_rebase() 121 u64 __arena *val; in arena_args5() 141 bpf_arena_free_pages(&arena, (void __arena *)val, 1); in arena_args5() 153 u64 __arena *val; in arena_arg_mixed() 168 bpf_arena_free_pages(&arena, (void __arena *)val, 1); in arena_arg_mixed() 181 u64 __arena *val; in arena_arg_unpopulated() [all …]
|
| H A D | arena_list.c | 29 struct arena_list_head __arena *list_head; 36 long __arena arena_sum; 37 int __arena test_val = 1; 38 struct arena_list_head __arena global_head; 58 struct elem __arena *n = bpf_alloc(sizeof(*n)); in arena_list_add() 75 struct elem __arena *n; in arena_list_del()
|
| H A D | arena_htab.c | 18 void __arena *htab_for_user; 22 char __arena arr1[100000]; 29 struct htab __arena *htab; in arena_htab_llvm() 30 char __arena *arr = arr1; in arena_htab_llvm()
|
| /linux/tools/testing/selftests/bpf/libarena/src/ |
| H A D | bitmap.bpf.c | 13 struct arena_bitmap __arena *bmp_alloc(size_t bits) in bmp_alloc() 15 struct arena_bitmap __arena *bmp; in bmp_alloc() 22 bmp = (struct arena_bitmap __arena *)arena_malloc(size); in bmp_alloc() 32 void bmp_free(struct arena_bitmap __arena *bmp) in bmp_free() 38 void __bmp_set_bit(u32 bit, struct arena_bitmap __arena *bmp) in __bmp_set_bit() 44 void __bmp_clear_bit(u32 bit, struct arena_bitmap __arena *bmp) in __bmp_clear_bit() 50 bool bmp_test_bit(u32 bit, struct arena_bitmap __arena *bmp) in bmp_test_bit() 56 bool bmp_test_and_clear_bit(u32 bit, struct arena_bitmap __arena *bmp) in bmp_test_and_clear_bit() 80 bool bmp_test_and_set_bit(u32 bit, struct arena_bitmap __arena *bmp) in bmp_test_and_set_bit() 104 void bmp_clear_bit(u32 bit, struct arena_bitmap __arena *bmp) in bmp_clear_bit() [all …]
|
| H A D | common.bpf.c | 7 struct buddy __arena buddy; 15 struct arena_qnode __arena __hidden qnodes[_Q_MAX_CPUS][_Q_MAX_NODES]; 53 __weak void __arena *arena_malloc(size_t size) in arena_malloc() 58 __weak void arena_free(void __arena *ptr) in arena_free()
|
| /linux/tools/sched_ext/include/scx/ |
| H A D | cid.bpf.h | 43 static __always_inline bool __cmask_contains(u32 cid, const struct scx_cmask __arena *m) in __cmask_contains() 48 static __always_inline u64 __arena *__cmask_word(u32 cid, const struct scx_cmask __arena *m) in __cmask_word() 50 return (u64 __arena *)&m->bits[cid / 64 - m->base / 64]; in __cmask_word() 63 static __always_inline void __cmask_init(struct scx_cmask __arena *m, u32 base, in __cmask_init() 94 static __always_inline void cmask_init(struct scx_cmask __arena *m, u32 base, u32 nr_cids) in cmask_init() 108 static __always_inline void cmask_reframe(struct scx_cmask __arena *m, u32 base, u32 nr_cids) in cmask_reframe() 125 static __always_inline bool cmask_test(u32 cid, const struct scx_cmask __arena *m) in cmask_test() 143 static __always_inline void cmask_set(u32 cid, struct scx_cmask __arena *m) in cmask_set() 145 u64 __arena *w; in cmask_set() 164 static __always_inline void cmask_clear(u32 cid, struct scx_cmask __arena *m) in cmask_clear() [all …]
|
| H A D | bpf_arena_common.h | 8 void __arena *__mptr = (void __arena *)(ptr); \ 16 #define __arena macro 26 static inline void __arena* bpf_arena_alloc_pages(void *map, void *addr, __u32 page_cnt, in bpf_arena_alloc_pages() 31 static inline void bpf_arena_free_pages(void *map, void __arena *ptr, __u32 page_cnt) in bpf_arena_free_pages()
|
| H A D | bpf_arena_common.bpf.h | 18 #ifndef __arena macro 19 #define __arena __attribute__((address_space(1))) 77 #define __arena 83 void __arena* bpf_arena_alloc_pages(void *map, void __arena *addr, __u32 page_cnt, 85 void bpf_arena_free_pages(void *map, void __arena *ptr, __u32 page_cnt) __ksym __weak; 86 int bpf_arena_reserve_pages(void *map, void __arena *ptr, __u32 page_cnt) __ksym __weak; 75 #define __arena global() macro
|
| /linux/tools/testing/selftests/bpf/ |
| H A D | bpf_arena_alloc.h | 16 static void __arena * __arena page_frag_cur_page[NR_CPUS]; 17 static int __arena page_frag_cur_offset[NR_CPUS]; 20 static inline void __arena* bpf_alloc(unsigned int size) in bpf_alloc() 22 __u64 __arena *obj_cnt; in bpf_alloc() 24 void __arena *page = page_frag_cur_page[cpu]; in bpf_alloc() 25 int __arena *cur_offset = &page_frag_cur_offset[cpu]; in bpf_alloc() 55 static inline void bpf_free(void __arena *addr) in bpf_free() 57 __u64 __arena *obj_cnt; in bpf_free() 59 addr = (void __arena *)(((lon in bpf_free() [all...] |
| H A D | bpf_arena_common.h | |
| H A D | bpf_arena_list.h | 8 typedef struct arena_list_node __arena arena_list_node_t; 12 arena_list_node_t * __arena *pprev; 16 struct arena_list_node __arena *first; 18 typedef struct arena_list_head __arena arena_list_head_t; 41 pos = list_entry_safe((void __arena *)___tmp, typeof(*(pos)), member)) 45 arena_list_node_t *first = h->first, * __arena *tmp; in list_add_head() 68 arena_list_node_t * __arena *pprev = n->pprev; in __list_del() 82 #define LIST_POISON1 ((void __arena *) 0x100 + POISON_POINTER_DELTA) 83 #define LIST_POISON2 ((void __arena *) 0x122 + POISON_POINTER_DELTA)
|
| H A D | bpf_arena_htab.h | 11 typedef struct htab_bucket __arena htab_bucket_t; 18 static inline htab_bucket_t *__select_bucket(struct htab __arena *htab, __u32 hash) 26 static inline arena_list_head_t *select_bucket(struct htab __arena *htab, __u32 hash) 37 typedef struct hashtab_elem __arena hashtab_elem_t; 55 __weak int htab_lookup_elem(struct htab __arena *htab, int key) 68 __weak int htab_update_elem(struct htab __arena *htab, int key, int value) 92 void htab_init(struct htab __arena *htab) 94 void __arena *buckets = bpf_arena_alloc_pages(&arena, NULL, 2, NUMA_NO_NODE, 0); in htab_init()
|
| /linux/tools/testing/selftests/bpf/libarena/include/ |
| H A D | bpf_arena_spin_lock.h | 59 struct arena_mcs_spinlock __arena *next; 106 extern struct arena_qnode __arena __hidden qnodes[_Q_MAX_CPUS][_Q_MAX_NODES]; 118 static inline struct arena_mcs_spinlock __arena *decode_tail(u32 tail) in decode_tail() 127 struct arena_mcs_spinlock __arena *grab_mcs_node(struct arena_mcs_spinlock __arena *base, int idx) in grab_mcs_node() 129 return &((struct arena_qnode __arena *)base + idx)->mcs; in grab_mcs_node() 144 static __always_inline u32 xchg_tail(arena_spinlock_t __arena *lock, u32 tail) in xchg_tail() 174 static __always_inline void clear_pending(arena_spinlock_t __arena *lock) in clear_pending() 187 static __always_inline void clear_pending_set_locked(arena_spinlock_t __arena *lock) in clear_pending_set_locked() 198 static __always_inline void set_locked(arena_spinlock_t __arena *lock) in set_locked() 204 u32 arena_fetch_set_pending_acquire(arena_spinlock_t __arena *lock) in arena_fetch_set_pending_acquire() [all …]
|
| /linux/tools/testing/selftests/bpf/libarena/selftests/ |
| H A D | test_buddy.bpf.c | 9 extern struct buddy __arena buddy; 12 u8 __arena *block; 18 static struct segarr_entry __arena segarr[SEGARRLEN]; 19 static void __arena *ptrs[17]; 20 size_t __arena alloc_sizes[] = { 3, 17, 1025, 129, 16350, 333, 9, 517 }; 21 size_t __arena alloc_multiple_sizes[] = { 3, 17, 1025, 129, 16350, 333, 9, 517, 2099 }; 22 size_t __arena alloc_free_sizes[] = { 3, 17, 64, 129, 256, 333, 512, 517 }; 23 size_t __arena alignment_sizes[] = { 1, 3, 7, 8, 9, 15, 16, 17, 31, 48 void __arena *mem; in test_buddy_alloc() 72 void __arena *mem; in test_buddy_alloc_free() [all …]
|
| H A D | test_bitmap.bpf.c | 11 static void test_bmp_setall(struct arena_bitmap __arena *bmp) in test_bmp_setall() 22 struct arena_bitmap __arena *bmp; in test_bitmap_alloc_free() 50 struct arena_bitmap __arena *bmp; in test_bitmap_bit_ops() 100 static bool test_bitmap_test_and_clear_single(struct arena_bitmap __arena *bmp, size_t ind) in test_bitmap_test_and_clear_single() 119 static bool test_bitmap_test_and_set_single(struct arena_bitmap __arena *bmp, size_t ind) in test_bitmap_test_and_set_single() 141 struct arena_bitmap __arena *bmp; in test_bitmap_test_and_clear_bit() 170 struct arena_bitmap __arena *bmp; in test_bitmap_test_and_set_bit() 197 struct arena_bitmap __arena *src1 = NULL, *src2 = NULL, *dst = NULL; in test_bitmap_and() 243 struct arena_bitmap __arena *src1 = NULL, *src2 = NULL, *dst = NULL; in test_bitmap_or() 288 struct arena_bitmap __arena *big = NULL, *small = NULL; in test_bitmap_subset() [all …]
|
| H A D | test_asan_buddy.bpf.c | 11 extern struct buddy __arena buddy; 19 u8 __arena *mem; in asan_test_buddy_oob_single() 57 __weak int asan_test_buddy_byte(u8 __arena *mem, int i, bool freed) in asan_test_buddy_byte() 76 u8 __arena *mem; in asan_test_buddy_uaf_single() 118 volatile struct buddy_blob __arena *blob; in asan_test_buddy_blob_single() 141 buddy_free(&buddy, (void __arena *)blob); in asan_test_buddy_blob_single()
|
| H A D | test_asan_common.h | 8 static inline void print_asan_map_state(void __arena *addr) in print_asan_map_state() 12 *(s8 __arena *)(addr), ASAN_GRANULE(addr), in print_asan_map_state() 20 static inline int asan_validate_addr(bool cond, void __arena *addr) in asan_validate_addr()
|
| /linux/tools/sched_ext/ |
| H A D | scx_qmap.h | 58 struct task_ctx __arena *head; 59 struct task_ctx __arena *tail; 139 struct task_ctx __arena *task_ctxs; 140 struct task_ctx __arena *task_free_head;
|
| /linux/tools/testing/selftests/sched_ext/ |
| H A D | enable_cmask.bpf.c | 59 static int check_mask(struct task_struct *p, const struct scx_cmask __arena *m, u64 *fp, in check_mask() 101 struct scx_cmask __arena *m = (struct scx_cmask __arena *)args->cmask_arena_addr; in BPF_STRUCT_OPS() 128 struct scx_cmask __arena *m) in BPF_STRUCT_OPS()
|