Re: [PATCH v11 35/37] x86/syscall: Split IDT syscall setup code into idt_syscall_init()

From: Thomas Gleixner
Date: Thu Sep 28 2023 - 14:02:00 EST


On Mon, Sep 25 2023 at 09:07, H. Peter Anvin wrote:
> On September 23, 2023 2:42:10 AM PDT, Xin Li <xin3.li@xxxxxxxxx> wrote:
>>+/* May not be marked __init: used by software suspend */
>>+void syscall_init(void)
>>+{
>>+ /* The default user and kernel segments */
>>+ wrmsr(MSR_STAR, 0, (__USER32_CS << 16) | __KERNEL_CS);
>>+
>>+ idt_syscall_init();
>>+}
>>+
>> #else /* CONFIG_X86_64 */
>>
>> #ifdef CONFIG_STACKPROTECTOR
>
> Am I missing something, or is this patch a noop?

Yes. It's a noop at this point. Later on it gains a

if (!fred)
idt_syscall_init();

Sure we could do

if (!fred) {
write_msr(foo...);
...
}

too, but I prefer the separation. No strong opinion though.

Thanks,

tglx