Re: [patch 35/37] x86/smpboot: Support parallel startup of secondary CPUs
From: Thomas Gleixner
Date: Sat Apr 15 2023 - 17:06:46 EST
On Sat, Apr 15 2023 at 09:22, Brian Gerst wrote:
> On Fri, Apr 14, 2023 at 7:45 PM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>> @@ -248,10 +311,20 @@ SYM_INNER_LABEL(secondary_startup_64_no_
>> *
>> * RDX contains the per-cpu offset
>> */
>> - movq pcpu_hot + X86_current_task(%rdx), %rax
>> - movq TASK_threadsp(%rax), %rsp
>> + movq pcpu_hot + X86_top_of_stack(%rdx), %rsp
>
> Switching to using pcpu_hot.top_of_stack is ok, but it's not
> completely equivalent. top_of_stack points to the end of the pt_regs
> structure, while the kernel stack starts below pt_regs even for kernel
> threads. So you need to subtract PTREGS_SIZE from the stack pointer
> after this.
>
> This change should also be a separate patch.
You're right on both counts.