Messages in this thread | | | From | Linus Torvalds <> | Date | Wed, 11 Oct 2023 12:40:09 -0700 | Subject | Re: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr() |
| |
On Wed, 11 Oct 2023 at 00:45, Uros Bizjak <ubizjak@gmail.com> wrote: > > In fact, rdgsbase is available only for 64-bit targets.
Not even all 64-bit targets. That's why I did that ALTERNATIVE() thing with X86_FEATURE_FSGSBASE, which uses the kernel instruction re-writing.
So that suggested asm of mine defaults to loading the value from memory through %gs, but with X86_FEATURE_FSGSBASE it gets rewritten to use rdgsbase.
And again - I'm not sure it's any faster, but it's _potentially_ certainly better in that it doesn't use the cache-line.
Linus
| |