Messages in this thread | | | From | Nadav Amit <> | Subject | Re: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr() | Date | Wed, 18 Oct 2023 18:29:06 +0000 |
| |
> On Oct 18, 2023, at 9:08 PM, Uros Bizjak <ubizjak@gmail.com> wrote: > > We can use alias to __seg_gs non-const memory, so the value can be > accessed without asm. __barrier() will then force reload. Please note > that any memory clobber, hidden inside asm will also force reload.
For the record, at the time I tried to find a creative solution to have fine granularity barrier control. I looked into address-spaces, pure and const function attributes, and use of the restrict keyword.
I did not find a better solution. The behavior of most of these mechanisms was non-intuitive for me and inconsistent across compilers.
You may succeed where I have failed as you seem more familiar with the compiler code, but be aware it is a rabbit hole...
| |