On Fri, Mar 21, 2025 at 12:18 AM Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote: > > BTW: You can use: > > > > --cut here-- > > diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h > > index 474d648bca9a..e6a7525c9db9 100644 > > --- a/arch/x86/include/asm/percpu.h > > +++ b/arch/x86/include/asm/percpu.h > > @@ -105,6 +105,10 @@ > > # define __my_cpu_type(var) typeof(var) __percpu_seg_override > > # define __my_cpu_ptr(ptr) (__my_cpu_type(*(ptr))*)(__force uintptr_t)(ptr) > > # define __my_cpu_var(var) (*__my_cpu_ptr(&(var))) > > + > > +# if __has_attribute(address_space) && defined(USE_TYPEOF_UNQUAL) > > +# define __percpu_qual __attribute__((address_space(3))) > > I see, so for undefined addr spaces clang x86 just ignores it. > Weird. But ok. It ignores undefined addr spaces in the sense that it does nothing with it. It has no effect on the access to variables in this addr space. OTOH, the compiler still applies address space checks. I plan to propose a (RFC?) patch after rc1, once the main part is applied to the mainline, that enables percpu checks also for clang. It is in effect just the above couple of lines. Uros.