Re: [PATCH RFC v2 46/54] s390: remove set_memory_rwnx()
From: Christophe Leroy (CS GROUP)
Date: Fri Dec 04 2026 - 04:41:21 EST
Le 03/12/2026 à 15:30, Mike Rapoport a écrit :
On Thu, Dec 03, 2026 at 11:49:25AM +0100, Heiko Carstens wrote:
On Thu, Nov 26, 2026 at 01:14:59PM +0200, Mike Rapoport (Microsoft) wrote:
set_memory_rwnx() has no users since commit 33bd8d153c33 ("s390: Keep
inittext section writable").
Remove it.
Signed-off-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
---
arch/s390/include/asm/set_memory.h | 1 -
1 file changed, 1 deletion(-)
I'd rather keep it, since it would be useful for execmem_force_rw(), which
is doing set_memory_nx() + set_memory_rw(), which could be replaced with
set_memory_rwnx().
set_memory*() calls are quite expensive on s390 (I guess that's true for all
architectures). Collapsing calls doesn't seem to be the worst idea.
I agree that it makes sense. riscv also has set_memory_rwnx() and it can be
added on x86 and maybe others as well.
Since the rework is going to be slow, I can take it from here and post
a more general patch that updates other architectures too.
RISCV names it set_memory_rw_nx() not set_memory_rwnx().
Something like the below maybe?
Yes would be nice to just do like for set_memory_rox(), with a fallback in include/linux/set_memory.h
Christophe