Re: [PATCH] MIPS: Make cpu_has_mips64r6 constant on 64-bit r6 kernels

From: Maciej W. Rozycki

Date: Fri Oct 30 2026 - 11:29:31 EST


On Fri, 30 Oct 2026, Tzu-Ching Yang wrote:

> diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
> index 3f11e5218e6c..2842e22c69ea 100644
> --- a/arch/mips/include/asm/cpu-features.h
> +++ b/arch/mips/include/asm/cpu-features.h
> @@ -317,7 +317,7 @@
> __isa_range_or_flag(5, 6, MIPS_CPU_ISA_M64R5))
> #endif
> #ifndef cpu_has_mips64r6
> -# define cpu_has_mips64r6 __isa_ge_and_flag(6, MIPS_CPU_ISA_M64R6)
> +# define cpu_has_mips64r6 (cpu_has_64bits && MIPS_ISA_REV >= 6)

Umm, the wrong fix. You want __isa_ge_or_flag() instead, plus obviously
`cpu_has_64bits' is also needed (and __isa_ge_and_flag() can be discarded;
I guess it was meant to take care of what `cpu_has_64bits' does and broke
the whole idea by mistake). Your proposal precludes the use of R6 stuff
with pre-R6 compilations -- not sure if that makes sense, but let's stay
consistent with these macro definitions.

Maciej