x86/syscall: Split IDT syscall setup code into idt_syscall_init()
authorXin Li <xin3.li@intel.com>
Tue, 5 Dec 2023 10:50:22 +0000 (02:50 -0800)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 31 Jan 2024 21:03:27 +0000 (22:03 +0100)
commit530dce278afffd8084af9a23493532912cdbe98a
treead89927dcab780786be38fa817223d0bb0cd8721
parent70d0fe5d0923abfb28c26e71171944f4801f9f38
x86/syscall: Split IDT syscall setup code into idt_syscall_init()

Because FRED uses the ring 3 FRED entrypoint for SYSCALL and SYSENTER and
ERETU is the only legit instruction to return to ring 3, there is NO need
to setup SYSCALL and SYSENTER MSRs for FRED, except the IA32_STAR MSR.

Split IDT syscall setup code into idt_syscall_init() to make it easy to
skip syscall setup code when FRED is enabled.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Xin Li <xin3.li@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Shan Kang <shan.kang@intel.com>
Link: https://lore.kernel.org/r/20231205105030.8698-34-xin3.li@intel.com
arch/x86/kernel/cpu/common.c