Re: [PATCH -tip 1/3] x86/percpu: Fix "const_pcpu_hot" version generation failure

From: Linus Torvalds
Date: Sun Dec 03 2023 - 17:19:52 EST


On Mon, 4 Dec 2023 at 07:12, Uros Bizjak <ubizjak@xxxxxxxxx> wrote:
>
> +/*
> + * The generic per-cpu infrastrucutre is not suitable for
> + * reading const-qualified variables.
> + */
> +#define this_cpu_read_const(pcp) ({ BUG(); (typeof(pcp))0; })

NAK. Absolutely not.

No way in hell is it acceptable to make this a run-time BUG. If it
doesn't work, it needs to be a compile failure. End of story.

Linus