mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
To: Alexei Starovoitov <ast@kernel.org>,
	 Andrii Nakryiko <andrii@kernel.org>,
	Andy Lutomirski <luto@kernel.org>,
	 Borislav Petkov <bp@alien8.de>,
	Daniel Borkmann <daniel@iogearbox.net>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	 Eduard Zingerman <eddyz87@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	 Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	 Peter Zijlstra <peterz@infradead.org>,
	Song Liu <song@kernel.org>,  Thomas Gleixner <tglx@kernel.org>
Cc: Emil Tsalapatis <emil@etsalapatis.com>,
	Jiri Olsa <jolsa@kernel.org>,
	 John Fastabend <john.fastabend@gmail.com>,
	 Martin KaFai Lau <martin.lau@linux.dev>,
	Mike Rapoport <rppt@kernel.org>,
	 "H. Peter Anvin" <hpa@zytor.com>,
	Yonghong Song <yonghong.song@linux.dev>,
	 bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	x86@kernel.org
Subject: [PATCH bpf-next v3 5/5] x86/bpf: enable EXECMEM_ROX_CACHE for BPF allocations
Date: Thu, 16 Jul 2026 10:51:39 +0300	[thread overview]
Message-ID: <20260716-execmem-x86-rox-bpf-v0-v3-5-4e76158c01c5@kernel.org> (raw)
In-Reply-To: <20260716-execmem-x86-rox-bpf-v0-v3-0-4e76158c01c5@kernel.org>

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) <rppt@kernel.org>
---
 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] = {

-- 
2.53.0


  parent reply	other threads:[~2026-07-16  7:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  7:51 [PATCH bpf-next v3 0/5] bpf, x86: " Mike Rapoport (Microsoft)
2026-07-16  7:51 ` [PATCH bpf-next v3 1/5] bpf: dispatcher: allocate bpf_dispatcher->rw_image with vzalloc() Mike Rapoport (Microsoft)
2026-07-16  8:52   ` bot+bpf-ci
2026-07-16  9:27     ` Mike Rapoport
2026-07-16  9:49       ` Kumar Kartikeya Dwivedi
2026-07-16  7:51 ` [PATCH bpf-next v3 2/5] bpf: drop __weak from bpf_jit_alloc_exec() and bpf_jit_free_exec() Mike Rapoport (Microsoft)
2026-07-16  7:51 ` [PATCH bpf-next v3 3/5] bpf: alloc_prog_pack(): skip ROX management for already ROX memory Mike Rapoport (Microsoft)
2026-07-16  7:51 ` [PATCH bpf-next v3 4/5] bpf, x86: make sure allocation in arch_bpf_trampoline_size() is writable Mike Rapoport (Microsoft)
2026-08-14 14:53   ` Jiri Olsa
2026-08-16  8:57     ` Mike Rapoport
2026-08-16 20:13       ` Jiri Olsa
2026-08-17 14:20       ` Daniel Borkmann
2026-08-16 20:44     ` Jiri Olsa
2026-07-16  7:51 ` Mike Rapoport (Microsoft) [this message]
2026-07-17  0:00 ` [PATCH bpf-next v3 0/5] bpf, x86: enable EXECMEM_ROX_CACHE for BPF allocations Song Liu
2026-07-17  6:41   ` Mike Rapoport
2026-07-17  7:27     ` Song Liu
2026-07-17  9:29       ` Mike Rapoport
2026-07-17 17:50         ` Song Liu
2026-07-19  9:23           ` Mike Rapoport
2026-07-21 17:59             ` Song Liu
2026-07-22  8:05               ` Mike Rapoport
2026-07-22 15:04                 ` Song Liu
2026-07-27  8:35                   ` Mike Rapoport
2026-07-22 15:40 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260716-execmem-x86-rox-bpf-v0-v3-5-4e76158c01c5@kernel.org \
    --to=rppt@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bp@alien8.de \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=hpa@zytor.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=song@kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®