-
-
Save eddyz87/1921247819138a9ed70d77db40db8a7c to your computer and use it in GitHub Desktop.
Replace "arena.1" with "address_space.1" section
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c | |
index 4fa4ade1ce74..971e719c4305 100644 | |
--- a/tools/bpf/bpftool/gen.c | |
+++ b/tools/bpf/bpftool/gen.c | |
@@ -121,7 +121,7 @@ static bool get_datasec_ident(const char *sec_name, char *buf, size_t buf_sz) | |
int i, n; | |
/* recognize hard coded LLVM section name */ | |
- if (strcmp(sec_name, ".arena.1") == 0) { | |
+ if (strcmp(sec_name, ".address_space.1") == 0) { | |
/* this is the name to use in skeleton */ | |
snprintf(buf, buf_sz, "arena"); | |
return true; | |
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c | |
index efab29b8935b..97bfb4a0c938 100644 | |
--- a/tools/lib/bpf/libbpf.c | |
+++ b/tools/lib/bpf/libbpf.c | |
@@ -498,7 +498,7 @@ struct bpf_struct_ops { | |
#define KSYMS_SEC ".ksyms" | |
#define STRUCT_OPS_SEC ".struct_ops" | |
#define STRUCT_OPS_LINK_SEC ".struct_ops.link" | |
-#define ARENA_SEC ".arena.1" | |
+#define ARENA_SEC ".address_space.1" | |
enum libbpf_map_type { | |
LIBBPF_MAP_UNSPEC, | |
diff --git a/tools/testing/selftests/bpf/bpf_arena_common.h b/tools/testing/selftests/bpf/bpf_arena_common.h | |
index bcf195c64a45..885d31cf934f 100644 | |
--- a/tools/testing/selftests/bpf/bpf_arena_common.h | |
+++ b/tools/testing/selftests/bpf/bpf_arena_common.h | |
@@ -32,7 +32,7 @@ | |
*/ | |
#endif | |
-#if defined(__BPF_FEATURE_ARENA_CAST) && !defined(BPF_ARENA_FORCE_ASM) | |
+#if defined(__BPF_FEATURE_ADDRESS_SPACE_CAST) && !defined(BPF_ARENA_FORCE_ASM) | |
#define __arena __attribute__((address_space(1))) | |
#define cast_kern(ptr) /* nop for bpf prog. emitted by LLVM */ | |
#define cast_user(ptr) /* nop for bpf prog. emitted by LLVM */ | |
diff --git a/tools/testing/selftests/bpf/progs/arena_htab.c b/tools/testing/selftests/bpf/progs/arena_htab.c | |
index b7bb712cacfd..5408553f5b09 100644 | |
--- a/tools/testing/selftests/bpf/progs/arena_htab.c | |
+++ b/tools/testing/selftests/bpf/progs/arena_htab.c | |
@@ -22,7 +22,7 @@ int zero = 0; | |
SEC("syscall") | |
int arena_htab_llvm(void *ctx) | |
{ | |
-#if defined(__BPF_FEATURE_ARENA_CAST) || defined(BPF_ARENA_FORCE_ASM) | |
+#if defined(__BPF_FEATURE_ADDRESS_SPACE_CAST) || defined(BPF_ARENA_FORCE_ASM) | |
struct htab __arena *htab; | |
__u64 i; | |
diff --git a/tools/testing/selftests/bpf/progs/arena_list.c b/tools/testing/selftests/bpf/progs/arena_list.c | |
index cd35b8448435..a3438433da78 100644 | |
--- a/tools/testing/selftests/bpf/progs/arena_list.c | |
+++ b/tools/testing/selftests/bpf/progs/arena_list.c | |
@@ -30,7 +30,7 @@ int list_sum; | |
int cnt; | |
bool skip = false; | |
-#ifdef __BPF_FEATURE_ARENA_CAST | |
+#ifdef __BPF_FEATURE_ADDRESS_SPACE_CAST | |
long __arena arena_sum; | |
int __arena test_val = 1; | |
struct arena_list_head __arena global_head; | |
@@ -44,7 +44,7 @@ int zero; | |
SEC("syscall") | |
int arena_list_add(void *ctx) | |
{ | |
-#ifdef __BPF_FEATURE_ARENA_CAST | |
+#ifdef __BPF_FEATURE_ADDRESS_SPACE_CAST | |
__u64 i; | |
list_head = &global_head; | |
@@ -66,7 +66,7 @@ int arena_list_add(void *ctx) | |
SEC("syscall") | |
int arena_list_del(void *ctx) | |
{ | |
-#ifdef __BPF_FEATURE_ARENA_CAST | |
+#ifdef __BPF_FEATURE_ADDRESS_SPACE_CAST | |
struct elem __arena *n; | |
int sum = 0; | |
diff --git a/tools/testing/selftests/bpf/progs/verifier_arena.c b/tools/testing/selftests/bpf/progs/verifier_arena.c | |
index 5540b05ff9ee..cd19ff37a20e 100644 | |
--- a/tools/testing/selftests/bpf/progs/verifier_arena.c | |
+++ b/tools/testing/selftests/bpf/progs/verifier_arena.c | |
@@ -19,7 +19,7 @@ SEC("syscall") | |
__success __retval(0) | |
int basic_alloc1(void *ctx) | |
{ | |
-#if defined(__BPF_FEATURE_ARENA_CAST) | |
+#if defined(__BPF_FEATURE_ADDRESS_SPACE_CAST) | |
volatile int __arena *page1, *page2, *no_page, *page3; | |
page1 = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0); | |
@@ -58,7 +58,7 @@ SEC("syscall") | |
__success __retval(0) | |
int basic_alloc2(void *ctx) | |
{ | |
-#if defined(__BPF_FEATURE_ARENA_CAST) | |
+#if defined(__BPF_FEATURE_ADDRESS_SPACE_CAST) | |
volatile char __arena *page1, *page2, *page3, *page4; | |
page1 = bpf_arena_alloc_pages(&arena, NULL, 2, NUMA_NO_NODE, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment