[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5a9d6d4aef78de6fc8a2cfc62922d06617cbe109.camel@infradead.org>
Date: Sat, 11 Mar 2023 09:55:08 +0000
From: David Woodhouse <dwmw2@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>,
Usama Arif <usama.arif@...edance.com>, kim.phillips@....com,
brgerst@...il.com
Cc: piotrgorski@...hyos.org, oleksandr@...alenko.name,
arjan@...ux.intel.com, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, hpa@...or.com, x86@...nel.org,
pbonzini@...hat.com, paulmck@...nel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
rcu@...r.kernel.org, mimoja@...oja.de, hewenliang4@...wei.com,
thomas.lendacky@....com, seanjc@...gle.com, pmenzel@...gen.mpg.de,
fam.zheng@...edance.com, punit.agrawal@...edance.com,
simon.evans@...edance.com, liangma@...ngbit.com,
"Guilherme G . Piccoli" <gpiccoli@...lia.com>
Subject: Re: [PATCH v14 10/12] x86/smpboot: Send INIT/SIPI/SIPI to secondary
CPUs in parallel
On Sat, 2023-03-11 at 10:54 +0200, Thomas Gleixner wrote:
> On Wed, Mar 08 2023 at 17:13, Usama Arif wrote:
> >
> > +/* Bringup step one: Send INIT/SIPI to the target AP */
> > +static int native_cpu_kick(unsigned int cpu)
> > +{
> > + return do_cpu_up(cpu, idle_thread_get(cpu));
>
> This idle_thread_get() is not sufficient. bringup_cpu() does:
>
> struct task_struct *idle = idle_thread_get(cpu);
>
> /*
> * Reset stale stack state from the last time this CPU was online.
> */
> scs_task_reset(idle);
> kasan_unpoison_task_stack(idle);
>
> But with this new model neither the shadow stack gets reset nor the
> kasan unpoisoning happens _before_ the to be kicked CPU starts
> executing.
>
> That needs a new function which does the get() and the above.
Ah, good catch. Those were added after we started on this journey :)
I think I'll do it with a 'bool unpoison' argument to
idle_thread_get(). Or just make it unconditional; they're idempotent
anyway and cheap enough? Kind of weird to be doing it from finish_cpu()
though, so I'll probably stick with the argument.
....*types*....
Erm, there are circumstances (!CONFIG_GENERIC_SMP_IDLE_THREAD) when
idle_thread_get() just unconditionally returns NULL.
At first glance, it doesn't look like scs_task_reset() copes with being
passed a NULL. Am I missing something?
$ grep -c GENERIC_SMP_IDLE_THREAD `grep -l SMP arch/*/Kconfig`
arch/alpha/Kconfig:1
arch/arc/Kconfig:1
arch/arm64/Kconfig:1
arch/arm/Kconfig:1
arch/csky/Kconfig:1
arch/hexagon/Kconfig:1
arch/ia64/Kconfig:1
arch/loongarch/Kconfig:1
arch/mips/Kconfig:1
arch/openrisc/Kconfig:1
arch/parisc/Kconfig:1
arch/powerpc/Kconfig:1
arch/riscv/Kconfig:1
arch/s390/Kconfig:1
arch/sh/Kconfig:1
arch/sparc/Kconfig:1
arch/um/Kconfig:0
arch/x86/Kconfig:1
arch/xtensa/Kconfig:1
Maybe just nobody but UM cares?
Download attachment "smime.p7s" of type "application/pkcs7-signature" (5965 bytes)
Powered by blists - more mailing lists