Re: {standard input}:4719: Error: opcode not supported on this processor: mips32r6 (mips32r6) `dmfgc0 $6,$9,7'

From: Maciej W. Rozycki
Date: Mon Sep 09 2024 - 10:08:43 EST


On Sat, 7 Sep 2024, kernel test robot wrote:

> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: b831f83e40a24f07c8dcba5be408d93beedc820f
> commit: a640d6762a7d404644201ebf6d2a078e8dc84f97 MIPS: mipsregs: Set proper ISA level for virt extensions
> date: 7 months ago
> config: mips-randconfig-r111-20240819 (https://download.01.org/0day-ci/archive/20240907/202409070438.79SGqcTc-lkp@xxxxxxxxx/config)
> compiler: mipsel-linux-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240907/202409070438.79SGqcTc-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202409070438.79SGqcTc-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
> {standard input}: Assembler messages:
> >> {standard input}:4719: Error: opcode not supported on this processor: mips32r6 (mips32r6) `dmfgc0 $6,$9,7'
> >> {standard input}:4731: Error: opcode not supported on this processor: mips32r6 (mips32r6) `dmtgc0 $2,$9,7'

This seems to me like a genuine underlying bug uncovered by the commit
referred. This is a CONFIG_32BIT kernel, so 64-bit instructions aren't
supposed to be emitted, and the macros concerned won't produce correct
code for the 32-bit psABI anyway if to be run on actual 64-bit hardware
(where unavoidable due to hardware oddities we sometimes do permit 64-bit
instructions with the 32-bit psABI in a careful arrangement, but it isn't
one here).

Maciej