[PATCH] arm64/kernel: Expose the running CPU of a native task in TPIDRRO_EL0
Guilherme G. Piccoli
gpiccoli at igalia.com
Sun Sep 6 07:55:19 PDT 2026
On 17/08/2026 11:48, Guilherme G. Piccoli wrote:
> Hi Will / Catalin / all,
> first of all, thanks for your prompt responses!
>
> I'm a bit confused on what "using the register" means here. We have 2
> ways of using it, IIUC:
>
> a) Use it as it's already used today! On kernel space, this register is
> kinda free, right? Currently, it's used as the scratch, in the entry.
> But nothing prevents other usages, given that, as the final step of exit
> to EL0, it's restored to the value of the CPU id. So, AFAIU, it's fair
> use on kernel space with or without this patch.
>
> b) Use as in "expose something else to userspace". Is it OK doing that,
> even the ARM specification mentioning
>
> "Purpose
> Provides a location where software executing at EL1 or higher can store
> thread identifying information that is visible to software executing at
> EL0, for OS management purposes." ?
>
> Or do you mean exposing **different information** than the pure CPU id,
> but still related with thread information?
>
> Would it be better if we guard this usage with a Kconfig? Or as Ryan
> already said, prctl flag or another idea?
>
>
> Finally, I would like to reinforce / disambiguate things here (though
> Ryan already mentioned): rseq or vDSO **are not** valid resources for
> our use case. What we are really interested is in having this register
> filled with CPU id.
> Cheers,
>
Hi Will / Catalin / others,
gentle ping on this one.
Could we implement it using a prctl flag or maybe Kconfig? Any other
ideas to move forward here?
Thanks again,
Guilherme
More information about the linux-arm-kernel
mailing list