From: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>,
Venkat Rao Bagalkote <venkat88@linux.ibm.com>,
linux-kernel@vger.kernel.org, chleroy@kernel.org,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Shrikanth Hegde <sshegde@linux.ibm.com>,
"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Subject: [PATCHv3 4/4] powerpc/mm: Drop PAGE_KERNEL_EXEC
Date: Wed, 25 Nov 2026 22:22:33 +0530 [thread overview]
Message-ID: <96692b22febc2c4ee366de072cebb57abd8ffb18.1795625038.git.ritesh.list@gmail.com> (raw)
In-Reply-To: <cover.1795625038.git.ritesh.list@gmail.com>
On powerpc PAGE_KERNEL_EXEC is just an alias to PAGE_KERNEL_X.
The comment above it's definition saying
("Make modules code happy. We don't set RO yet"), is stale.
Since commit 4fcc636615b1 ("powerpc/modules: Make module_alloc() Strict Module
RWX aware") module text is allocated with PAGE_KERNEL when STRICT_MODULE_RWX is
enabled and only made executable later, so there is no longer a reason for
a separate name.
Convert the remaining users to PAGE_KERNEL_X and remove the definition.
No functional change intended.
Suggested-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
---
arch/powerpc/include/asm/pgtable.h | 3 ---
arch/powerpc/mm/mem.c | 4 ++--
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index d20ff2ae02f5..ea06a85f0fa8 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -20,9 +20,6 @@ struct mm_struct;
#include <asm/nohash/pgtable.h>
#endif /* !CONFIG_PPC_BOOK3S */
-/* Make modules code happy. We don't set RO yet */
-#define PAGE_KERNEL_EXEC PAGE_KERNEL_X
-
/* Advertise special mapping type for AGP */
#define PAGE_AGP (PAGE_KERNEL_NC)
#define HAVE_PAGE_AGP
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 8a0fdfd028dd..bc83e45b7ae9 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -388,8 +388,8 @@ static void prealloc_execmem_pgtable(void) { }
struct execmem_info __init *execmem_arch_setup(void)
{
- pgprot_t kprobes_prot = strict_kernel_rwx_enabled() ? PAGE_KERNEL_ROX : PAGE_KERNEL_EXEC;
- pgprot_t prot = strict_module_rwx_enabled() ? PAGE_KERNEL : PAGE_KERNEL_EXEC;
+ pgprot_t kprobes_prot = strict_kernel_rwx_enabled() ? PAGE_KERNEL_ROX : PAGE_KERNEL_X;
+ pgprot_t prot = strict_module_rwx_enabled() ? PAGE_KERNEL : PAGE_KERNEL_X;
unsigned long fallback_start = 0, fallback_end = 0;
unsigned long kprobes_start, kprobes_end;
unsigned long start, end;
--
2.39.5
prev parent reply other threads:[~2026-11-25 16:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 16:52 [PATCHv3 0/4] powerpc: kprobes insn page fixes Ritesh Harjani (IBM)
2026-11-25 16:52 ` [PATCHv3 1/4] powerpc/execmem: Don't leave kprobes insn pages W+X when CONFIG_MODULES=n Ritesh Harjani (IBM)
2026-11-25 16:52 ` [PATCHv3 2/4] powerpc/execmem: Allocate kprobes insn pages from the modules area on book3s/32 Ritesh Harjani (IBM)
2026-11-25 16:52 ` [PATCHv3 3/4] powerpc/ptdump: Show the exec flag of kernel mappings on e500 Ritesh Harjani (IBM)
2026-11-25 16:52 ` Ritesh Harjani (IBM) [this message]
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=96692b22febc2c4ee366de072cebb57abd8ffb18.1795625038.git.ritesh.list@gmail.com \
--to=ritesh.list@gmail.com \
--cc=chleroy@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=sshegde@linux.ibm.com \
--cc=venkat88@linux.ibm.com \
/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®