From 6b88aaec81db48a76162361e5f734d2c729a02b1 Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Thu, 16 Jul 2026 10:51:39 +0300 Subject: [PATCH] x86/bpf: Enable EXECMEM_ROX_CACHE for BPF allocations BPF core and x86 JIT use text poking and temporary writable buffers and thus can handle ROX memory. Enable ROX cache for EXECMEM_BPF when configuration and CPU features allow that. Signed-off-by: Mike Rapoport (Microsoft) Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20260716-execmem-x86-rox-bpf-v0-v3-5-4e76158c01c5@kernel.org Signed-off-by: Kumar Kartikeya Dwivedi --- arch/x86/mm/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index fb67217fddcd..079f8c7e9e3c 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -1107,10 +1107,10 @@ struct execmem_info __init *execmem_arch_setup(void) .alignment = MODULE_ALIGN, }, [EXECMEM_BPF] = { - .flags = EXECMEM_KASAN_SHADOW, + .flags = flags, .start = start, .end = MODULES_END, - .pgprot = PAGE_KERNEL, + .pgprot = pgprot, .alignment = MODULE_ALIGN, }, [EXECMEM_MODULE_DATA] = {