Messages in this thread | | | Date | Sun, 19 Mar 2023 17:34:09 +0100 | From | Borislav Petkov <> | Subject | Re: [PATCH v15 02/12] cpu/hotplug: Move idle_thread_get() to <linux/smpboot.h> |
| |
On Thu, Mar 16, 2023 at 10:20:59PM +0000, Usama Arif wrote: > From: David Woodhouse <dwmw@amazon.co.uk> > > Instead of relying purely on the special-case wrapper in bringup_cpu() > to pass the idle thread to __cpu_up(), expose idle_thread_get() so that > the architecture code can obtain it directly when necessary. > > This will be useful when the existing __cpu_up() is split into multiple > phases, only *one* of which will actually need the idle thread. > > If the architecture code is to register its new pre-bringup states with > the cpuhp core, having a special-case wrapper to pass extra arguments is > non-trivial and it's easier just to let the arch register its function > pointer to be invoked with the standard API. > > To reduce duplication, move the shadow stack reset and kasan unpoisoning
I was wondering what "shadow stack" as that set is not upstream yet. You mean "shadow call stack" which is apparently something else, compiler-generated, purely software thing.
> into idle_thread_get() too.
Frankly, I don't think resetting shadow call stack and kasan state belongs in a function which returns the idle thread. Even more so if you have to add an @unpoison param which is false sometimes and sometimes true, depending on where you call the function.
I think you should have a helper
tsk_reset_stacks(struct task_struct *tsk);
or so which is called where @unpoison == true instead of having a getter function do something unrelated too.
Thx.
-- Regards/Gruss, Boris.
https://people.kernel.org/tglx/notes-about-netiquette
| |