mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* arch/riscv/lib/strncmp.S:11: Error: unrecognized opcode `__alternative_cfg("nop", "j strncmp_zbb",0,30,'
@ 2025-04-12 23:18 kernel test robot
  2025-04-14 10:11 ` Andrew Jones
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-04-12 23:18 UTC (permalink / raw)
  To: Conor Dooley
  Cc: oe-kbuild-all, linux-kernel, Alexandre Ghiti, Andrew Jones,
	Charlie Jenkins, Samuel Holland

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b676ac484f847bbe5c7d29603f41475b64fefe55
commit: 9343aaba1f256ff42730db5a61efc32a86149776 RISC-V: separate Zbb optimisations requiring and not requiring toolchain support
date:   4 weeks ago
config: riscv-randconfig-001-20250413 (https://download.01.org/0day-ci/archive/20250413/202504130710.3IKz6Ibs-lkp@intel.com/config)
compiler: riscv32-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250413/202504130710.3IKz6Ibs-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504130710.3IKz6Ibs-lkp@intel.com/

All errors (new ones prefixed by >>):

   arch/riscv/lib/strncmp.S: Assembler messages:
>> arch/riscv/lib/strncmp.S:11: Error: unrecognized opcode `__alternative_cfg("nop", "j strncmp_zbb",0,30,'
>> arch/riscv/lib/strncmp.S:12: Error: junk at end of line, first unrecognized character is `0'
--
   arch/riscv/lib/strlen.S: Assembler messages:
>> arch/riscv/lib/strlen.S:11: Error: unrecognized opcode `__alternative_cfg("nop", "j strlen_zbb",0,30,'
>> arch/riscv/lib/strlen.S:12: Error: junk at end of line, first unrecognized character is `0'
--
   arch/riscv/lib/strcmp.S: Assembler messages:
>> arch/riscv/lib/strcmp.S:11: Error: unrecognized opcode `__alternative_cfg("nop", "j strcmp_zbb",0,30,'
>> arch/riscv/lib/strcmp.S:12: Error: junk at end of line, first unrecognized character is `0'


vim +11 arch/riscv/lib/strncmp.S

    10	
  > 11		__ALTERNATIVE_CFG("nop", "j strncmp_zbb", 0, RISCV_ISA_EXT_ZBB,
  > 12			IS_ENABLED(CONFIG_RISCV_ISA_ZBB) && IS_ENABLED(CONFIG_TOOLCHAIN_HAS_ZBB))
    13	
    14		/*
    15		 * Returns
    16		 *   a0 - comparison result, value like strncmp
    17		 *
    18		 * Parameters
    19		 *   a0 - string1
    20		 *   a1 - string2
    21		 *   a2 - number of characters to compare
    22		 *
    23		 * Clobbers
    24		 *   t0, t1, t2
    25		 */
    26		li	t2, 0
    27	1:
    28		beq	a2, t2, 2f
    29		lbu	t0, 0(a0)
    30		lbu	t1, 0(a1)
    31		addi	a0, a0, 1
    32		addi	a1, a1, 1
    33		bne	t0, t1, 3f
    34		addi	t2, t2, 1
    35		bnez	t0, 1b
    36	2:
    37		li	a0, 0
    38		ret
    39	3:
    40		/*
    41		 * strncmp only needs to return (< 0, 0, > 0) values
    42		 * not necessarily -1, 0, +1
    43		 */
    44		sub	a0, t0, t1
    45		ret
    46	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: arch/riscv/lib/strncmp.S:11: Error: unrecognized opcode `__alternative_cfg("nop", "j strncmp_zbb",0,30,'
  2025-04-12 23:18 arch/riscv/lib/strncmp.S:11: Error: unrecognized opcode `__alternative_cfg("nop", "j strncmp_zbb",0,30,' kernel test robot
@ 2025-04-14 10:11 ` Andrew Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Jones @ 2025-04-14 10:11 UTC (permalink / raw)
  To: kernel test robot
  Cc: Conor Dooley, oe-kbuild-all, linux-kernel, Alexandre Ghiti,
	Charlie Jenkins, Samuel Holland

On Sun, Apr 13, 2025 at 07:18:45AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   b676ac484f847bbe5c7d29603f41475b64fefe55
> commit: 9343aaba1f256ff42730db5a61efc32a86149776 RISC-V: separate Zbb optimisations requiring and not requiring toolchain support
> date:   4 weeks ago
> config: riscv-randconfig-001-20250413 (https://download.01.org/0day-ci/archive/20250413/202504130710.3IKz6Ibs-lkp@intel.com/config)
> compiler: riscv32-linux-gcc (GCC) 14.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250413/202504130710.3IKz6Ibs-lkp@intel.com/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@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202504130710.3IKz6Ibs-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>    arch/riscv/lib/strncmp.S: Assembler messages:
> >> arch/riscv/lib/strncmp.S:11: Error: unrecognized opcode `__alternative_cfg("nop", "j strncmp_zbb",0,30,'
> >> arch/riscv/lib/strncmp.S:12: Error: junk at end of line, first unrecognized character is `0'
> --
>    arch/riscv/lib/strlen.S: Assembler messages:
> >> arch/riscv/lib/strlen.S:11: Error: unrecognized opcode `__alternative_cfg("nop", "j strlen_zbb",0,30,'
> >> arch/riscv/lib/strlen.S:12: Error: junk at end of line, first unrecognized character is `0'
> --
>    arch/riscv/lib/strcmp.S: Assembler messages:
> >> arch/riscv/lib/strcmp.S:11: Error: unrecognized opcode `__alternative_cfg("nop", "j strcmp_zbb",0,30,'
> >> arch/riscv/lib/strcmp.S:12: Error: junk at end of line, first unrecognized character is `0'
>

We're missing __ALTERNATIVE_CFG() for !RISCV_ALTERNATIVE && __ASSEMBLY__
and I see some other missing/broken macros on the !RISCV_ALTERNATIVE side.
I'll send a patch.

Thanks,
drew

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-14 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-12 23:18 arch/riscv/lib/strncmp.S:11: Error: unrecognized opcode `__alternative_cfg("nop", "j strncmp_zbb",0,30,' kernel test robot
2025-04-14 10:11 ` Andrew Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®