Re: [RFC PATCH 0/4] x86/percpu: Use segment qualifiers

From: Ingo Molnar
Date: Tue Oct 03 2023 - 09:38:10 EST



* Uros Bizjak <ubizjak@xxxxxxxxx> wrote:

> > Maybe, but Linus's reluctance and caution is justified IMHO, and at
> > minimum this feature needs some careful evaluation of long-time
> > suitability [*] ...
>
> I do have a proposal on how to introduce a new feature while minimising
> risk as much as possible. I must admit that detecting the feature for all
> released compilers that can handle __seg_gs seems quite risky (I have to
> curb my enthusiasm somehow ;) ), so perhaps a staged approach with a
> currently unreleased compiler is more appropriate. Using:
>
> +config CC_HAS_NAMED_AS
> + def_bool CC_IS_GCC && GCC_VERSION >= 140000
>
> would enable the new feature only for currently unreleased experimental
> GCC. This would allow to qualify the compiler and weed out any possible
> problems, before the compiler is released. Please note, that the patch is
> written in such a way, that the code reverts to the existing approach for
> undefined CC_HAS_NAMED_AS.

So I don't think it's a good idea to restrict it to the devel GCC version
only, the cross-section of devel-GCC and devel-kernel reduces testing
coverage to near-zero in practice ...

Instead, if Linus doesn't disagree that is, how about restricting it to the
freshest GCC minor version? Ie. GCC 13.1 and later. We could carry it in a
separate branch in -tip for a while and not merge it into v6.7 but v6.8 or
so.

That would at least give us *some* amount of test coverage, without any
real upstream risk.

Thanks,

Ingo