Re: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr()

From: Linus Torvalds
Date: Wed Oct 18 2023 - 14:11:49 EST


On Wed, 18 Oct 2023 at 10:23, Uros Bizjak <ubizjak@xxxxxxxxx> wrote:
>
> In processor.h, we have:
>
> static __always_inline unsigned long current_top_of_stack(void)

Yeah, but that is never used multiple times afaik. I think it's purely
for things like

WARN_ON_ONCE(!on_thread_stack());

in the entry code, for example.

So I guess it can use the same infrastructure, but I doubt it matters
in any practical way.

Grepping around for it, it looks like the 32-bit code has some stale commentary:

* Reload esp0 and pcpu_hot.top_of_stack. This changes
* current_thread_info().

but that seems entirely bogus. We historically picked up
current_thread_info() from %esp, but that hasn't been true in ages,
afaik. Now it's all based on 'current'.

Linus