Skip to content

Commit 36388e3

Browse files
committed
x86/execmem: fix ROX cache usage in Xen PV guests
jira LE-4694 Rebuild_History Non-Buildable kernel-6.12.0-55.43.1.el10_0 commit-author Juergen Gross <jgross@suse.com> commit 59f5910 The recently introduced ROX cache for modules is assuming large page support in 64-bit mode without testing the related feature bit. This results in breakage when running as a Xen PV guest, as in this mode large pages are not supported. Fix that by testing the X86_FEATURE_PSE capability when deciding whether to enable the ROX cache. Link: https://lkml.kernel.org/r/20250103065631.26459-1-jgross@suse.com Fixes: 2e45474 ("execmem: add support for cache of large ROX pages") Signed-off-by: Juergen Gross <jgross@suse.com> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> Cc: Luis Chamberlain <mcgrof@kernel.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Mike Rapoport (Microsoft) <rppt@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> (cherry picked from commit 59f5910) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 0d69206 commit 36388e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/mm/init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,8 @@ struct execmem_info __init *execmem_arch_setup(void)
10751075

10761076
start = MODULES_VADDR + offset;
10771077

1078-
if (IS_ENABLED(CONFIG_ARCH_HAS_EXECMEM_ROX)) {
1078+
if (IS_ENABLED(CONFIG_ARCH_HAS_EXECMEM_ROX) &&
1079+
cpu_feature_enabled(X86_FEATURE_PSE)) {
10791080
pgprot = PAGE_KERNEL_ROX;
10801081
flags = EXECMEM_KASAN_SHADOW | EXECMEM_ROX_CACHE;
10811082
} else {

0 commit comments

Comments
 (0)