Re: [PATCH v10 2/2] riscv: Add runtime constant support

From: Klara Modin
Date: Fri Mar 28 2025 - 16:22:21 EST


Hi Alex,

On 3/28/25 18:35, Alexandre Ghiti wrote:
Hi Klara,

On Fri, Mar 28, 2025 at 4:42 PM Klara Modin <klarasmodin@xxxxxxxxx> wrote:

Hi,

On 3/19/25 19:35, Charlie Jenkins wrote:
Implement the runtime constant infrastructure for riscv. Use this
infrastructure to generate constants to be used by the d_hash()
function.

This is the riscv variant of commit 94a2bc0f611c ("arm64: add 'runtime
constant' support") and commit e3c92e81711d ("runtime constants: add
x86 architecture support").

This patch causes the following build failure for me:

fs/dcache.c: Assembler messages:
fs/dcache.c:157: Error: attempt to move .org backwards
fs/dcache.c:157: Error: attempt to move .org backwards
fs/dcache.c:157: Error: attempt to move .org backwards
fs/dcache.c:157: Error: attempt to move .org backwards
fs/dcache.c:157: Error: attempt to move .org backwards
make[3]: *** [scripts/Makefile.build:203: fs/dcache.o] Error 1

The value of CONFIG_RISCV_ISA_ZBKB doesn't seem to have an impact.
Reverting the patch on top of next-20250328 resolved the issue for me. I
attached the generated fs/dcache.s.

Thanks for your report!

Kernel test robot reported the following issue, do you have the same errors?

fs/dcache.c: Assembler messages:
fs/dcache.c:143: Warning: Unrecognized .option directive: arch,+zba
--
fs/dcache.c:145: Error: unrecognized opcode `add.uw s1,s1,a5'
fs/dcache.c:143: Warning: Unrecognized .option directive: arch,+zba
--
fs/dcache.c:145: Error: unrecognized opcode `add.uw a4,a4,a5'
fs/dcache.c:143: Warning: Unrecognized .option directive: arch,+zba
--
fs/dcache.c:145: Error: unrecognized opcode `add.uw s4,s4,a5'
fs/dcache.c:143: Warning: Unrecognized .option directive: arch,+zba
--
fs/dcache.c:145: Error: unrecognized opcode `add.uw s1,s1,a5'
fs/dcache.c:152: Error: attempt to move .org backwards
fs/dcache.c:152: Error: attempt to move .org backwards
fs/dcache.c:152: Error: attempt to move .org backwards
fs/dcache.c:152: Error: attempt to move .org backwards

If so, I sent a fix, don't hesitate to add your Tested-by:
https://lore.kernel.org/linux-riscv/c0f425ec-6c76-45b2-b1bc-8d9be028a878@xxxxxxxxxxxx/T/#me1469bfb2e6f69e1422a136014b753a6acaa3bc6

I only saw the attempt to move .org backwards error. I'm using binutils 2.44 and a GCC 15 snapshot from 2025-03-23 so I don't think the toolchain support for zba should be the issue. The fix didn't make any difference for me.

However, it seems this could be something in GCC 15 as when I retried with GCC 14.2 and 12.4 I could no longer see the issue.

Regards,
Klara Modin


Thanks,

Alex



Please let me know if there's anything else you need.

Regards,
Klara Modin