From 1022438243d8521e6c9efb53a21d18d62d0a9417 Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Wed, 30 Apr 2025 12:57:42 -0700 Subject: [PATCH] ANDROID: 16K: Avoid conflicting __PAGE_SIZE in bpf/core Android uses __PAGE_SIZE for larger than 4KB base page size emulation on x86_64. Undef this to avoid conflicts with bpf core's usage of __PAGE_SIZE. Bug: 383389337 Bug: 383389337 Change-Id: Iae21f4bc7d0541687c98f0ac75ac93a6ed341bc7 Signed-off-by: Kalesh Singh --- kernel/bpf/core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index a60a6a2ce0d7..fbfb1eed5a1f 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -89,6 +89,15 @@ void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb, int k, uns return NULL; } +/* + * Android uses __PAGE_SIZE for larger than 4KB base page size emulation + * on x86_64. Undef this to avoid conflicts with bpf core's usage of + * __PAGE_SIZE in this compilation unit. + */ +#ifdef __PAGE_SIZE +#undef __PAGE_SIZE +#endif + /* tell bpf programs that include vmlinux.h kernel's PAGE_SIZE */ enum page_size_enum { __PAGE_SIZE = PAGE_SIZE