Skip to content

Commit 402e63d

Browse files
Jiri Kosinagregkh
authored andcommitted
kaiser: disabled on Xen PV
Kaiser cannot be used on paravirtualized MMUs (namely reading and writing CR3). This does not work with KAISER as the CR3 switch from and to user space PGD would require to map the whole XEN_PV machinery into both. More importantly, enabling KAISER on Xen PV doesn't make too much sense, as PV guests use distinct %cr3 values for kernel and user already. Signed-off-by: Jiri Kosina <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2c27217 commit 402e63d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/x86/mm/kaiser.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,9 @@ void __init kaiser_check_boottime_disable(void)
263263
char arg[5];
264264
int ret;
265265

266+
if (boot_cpu_has(X86_FEATURE_XENPV))
267+
goto silent_disable;
268+
266269
ret = cmdline_find_option(boot_command_line, "pti", arg, sizeof(arg));
267270
if (ret > 0) {
268271
if (!strncmp(arg, "on", 2))
@@ -290,6 +293,8 @@ void __init kaiser_check_boottime_disable(void)
290293

291294
disable:
292295
pr_info("Kernel/User page tables isolation: disabled\n");
296+
297+
silent_disable:
293298
kaiser_enabled = 0;
294299
setup_clear_cpu_cap(X86_FEATURE_KAISER);
295300
}

0 commit comments

Comments
 (0)