]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mips: cps: Assemble jr.hb with an R2 ISA level
authorRosen Penev <rosenp@gmail.com>
Thu, 7 May 2026 23:23:23 +0000 (16:23 -0700)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Tue, 26 May 2026 14:35:36 +0000 (16:35 +0200)
commite5d64f868e484da06f5c141c18c32c01c269625e
tree7ea0dcc6d56591ad8e4372c10403a94a55e776d0
parent7fb13fd35110ebe95eb053faf79d018f51144d85
mips: cps: Assemble jr.hb with an R2 ISA level

A MIPS allmodconfig built with LLVM can select CPU_MIPS32_R1 together
with MIPS_MT_SMP. In that configuration clang invokes the integrated
assembler with -march=mips32, and the MIPS MT path in cps-vec.S fails
to assemble two jr.hb instructions:

  arch/mips/kernel/cps-vec.S:376:2: error: instruction requires
  a CPU feature not currently enabled

  arch/mips/kernel/cps-vec.S:490:4: error: instruction requires
  a CPU feature not currently enabled

The earlier jr.hb in the same file is already assembled inside a .set
MIPS_ISA_LEVEL_RAW scope. The two failing sites are reached after
popping back to the file's base ISA level, so LLVM correctly rejects
them for an R1 target.

Wrap those jr.hb instructions in the same ISA-level push/pop used by
the working site. This keeps the MT code unchanged while making the
required R2 hazard-branch encoding explicit to the assembler.

Assisted-by: Codex:GPT-5.5
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/kernel/cps-vec.S