Skip to content

Commit 8d4b067

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
x86/mm/pti: Force entry through trampoline when PTI active
Force the entry through the trampoline only when PTI is active. Otherwise go through the normal entry code. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Borislav Petkov <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Boris Ostrovsky <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Dave Hansen <[email protected]> Cc: David Laight <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Greg KH <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Juergen Gross <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Will Deacon <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 03f4424 commit 8d4b067

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/x86/kernel/cpu/common.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,10 @@ void syscall_init(void)
13391339
(entry_SYSCALL_64_trampoline - _entry_trampoline);
13401340

13411341
wrmsr(MSR_STAR, 0, (__USER32_CS << 16) | __KERNEL_CS);
1342-
wrmsrl(MSR_LSTAR, SYSCALL64_entry_trampoline);
1342+
if (static_cpu_has(X86_FEATURE_PTI))
1343+
wrmsrl(MSR_LSTAR, SYSCALL64_entry_trampoline);
1344+
else
1345+
wrmsrl(MSR_LSTAR, (unsigned long)entry_SYSCALL_64);
13431346

13441347
#ifdef CONFIG_IA32_EMULATION
13451348
wrmsrl(MSR_CSTAR, (unsigned long)entry_SYSCALL_compat);

0 commit comments

Comments
 (0)