Skip to content

Commit 59f5910

Browse files
jgross1akpm00
authored andcommitted
x86/execmem: fix ROX cache usage in Xen PV guests
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/[email protected] Fixes: 2e45474 ("execmem: add support for cache of large ROX pages") Signed-off-by: Juergen Gross <[email protected]> Reported-by: Marek Marczykowski-Górecki <[email protected]> Tested-by: Marek Marczykowski-Górecki <[email protected]> Cc: Luis Chamberlain <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Dave Hansen <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Mike Rapoport (Microsoft) <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent f505e6c commit 59f5910

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
@@ -1080,7 +1080,8 @@ struct execmem_info __init *execmem_arch_setup(void)
10801080

10811081
start = MODULES_VADDR + offset;
10821082

1083-
if (IS_ENABLED(CONFIG_ARCH_HAS_EXECMEM_ROX)) {
1083+
if (IS_ENABLED(CONFIG_ARCH_HAS_EXECMEM_ROX) &&
1084+
cpu_feature_enabled(X86_FEATURE_PSE)) {
10841085
pgprot = PAGE_KERNEL_ROX;
10851086
flags = EXECMEM_KASAN_SHADOW | EXECMEM_ROX_CACHE;
10861087
} else {

0 commit comments

Comments
 (0)