On 16.01.2024 09:41, Jan Beulich wrote:
> While not performance critical, these hook invocations still want
> converting: This way all pre-filled struct cpu_dev instances can become
> __initconst_cf_clobber, thus allowing to eliminate further 8 ENDBR
> during the 2nd phase of alternatives patching (besides moving previously
> resident data to .init.*).
> 
> Since all use sites need touching anyway, take the opportunity and also
> address a Misra C:2012 Rule 5.5 violation: Rename the this_cpu static
> variable.
> 
> Signed-off-by: Jan Beulich <[email protected]>
> ---
> With LTO it might end up necessary to tag as __used more than just
> "default_cpu".

Yet then ...

> --- a/xen/arch/x86/cpu/common.c
> +++ b/xen/arch/x86/cpu/common.c
> @@ -113,10 +113,10 @@ static void cf_check default_init(struct
>       __clear_bit(X86_FEATURE_SEP, c->x86_capability);
>  }
>  
> -static const struct cpu_dev default_cpu = {
> +static const struct cpu_dev __initconst_cf_clobber default_cpu = {

... I sent a stale patch, where __used was still missing here.

Considering the intention behind __initconst_cf_clobber I wonder
whether we wouldn't better integrate __used into that macro, such
that we become independent of optimizations the tool chain may be
doing.

Jan

Reply via email to