Skip to contentSkip to conversation

x86-ftrace-enable-execmem_rox_cache-for-ftrace-allocations.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Aug 2, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: x86/ftrace: enable EXECMEM_ROX_CACHE for ftrace allocations
has been removed from the -mm tree. Its filename was
x86-ftrace-enable-execmem_rox_cache-for-ftrace-allocations.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: "Mike Rapoport (Microsoft)" <[email protected]>
Subject: x86/ftrace: enable EXECMEM_ROX_CACHE for ftrace allocations
Date: Sun, 13 Jul 2025 10:17:30 +0300

For the most part ftrace uses text poking and can handle ROX memory. The only place that requires writable memory is create_trampoline() that updates the allocated memory and in the end makes it ROX.

Use execmem_alloc_rw() in x86::ftrace::alloc_tramp() and enable ROX cache for EXECMEM_FTRACE when configuration and CPU features allow that.

---

 arch/x86/kernel/ftrace.c |    2 +-
 arch/x86/mm/init.c       |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
arch/x86/kernel/ftrace.c renamed from arch/x86/kernel/ftrace.c~x86-ftrace-enable-execmem_rox_cache-for-ftrace-allocations +1 -1
@@ -263,7 +263,7 @@ void arch_ftrace_update_code(int command
 
 static inline void *alloc_tramp(unsigned long size)
 {
-	return execmem_alloc(EXECMEM_FTRACE, size);
+	return execmem_alloc_rw(EXECMEM_FTRACE, size);
 }
 static inline void tramp_free(void *tramp)
 {
arch/x86/mm/init.c renamed from arch/x86/mm/init.c~x86-ftrace-enable-execmem_rox_cache-for-ftrace-allocations +8 -1
@@ -1105,7 +1105,14 @@ struct execmem_info __init *execmem_arch
 				.pgprot	= PAGE_KERNEL_ROX,
 				.alignment = MODULE_ALIGN,
 			},
-			[EXECMEM_FTRACE ... EXECMEM_BPF] = {
+			[EXECMEM_FTRACE] = {
+				.flags	= flags,
+				.start	= start,
+				.end	= MODULES_END,
+				.pgprot	= pgprot,
+				.alignment = MODULE_ALIGN,
+			},
+			[EXECMEM_BPF] = {
 				.flags	= EXECMEM_KASAN_SHADOW,
 				.start	= start,
 				.end	= MODULES_END,

_

Patches currently in -mm which might be from [email protected] are

kho-add-test-for-kexec-handover.patch
kho-add-test-for-kexec-handover-fix.patch