[PATCH v2] selftests/rseq: Fix a building error for riscv arch

Paul Walmsley pjw at kernel.org
Wed Jul 8 16:05:29 PDT 2026


On Tue, 7 Jul 2026, Hui Wang wrote:

> RISC-V rseq selftests include asm/fence.h from tools/arch/riscv,
> but the rseq Makefile only adds tools/include in the CFLAGS, this
> results in the building failure both for native and cross build:
> 
>     In file included from rseq.h:131,
>                      from rseq.c:37:
>     rseq-riscv.h:11:10: fatal error: asm/fence.h: No such file or directory
> 
> To fix it, add the matching tools/arch/$(ARCH)/include path in the
> CFLAGS and derive ARCH from SUBARCH for standalone native builds where
> ARCH is not set.
> 
> Fixes: c92786e179e0 ("KVM: riscv: selftests: Use the existing RISCV_FENCE macro in `rseq-riscv.h`")
> Cc: stable at vger.kernel.org
> Signed-off-by: Hui Wang <hui.wang at canonical.com>

Thanks, queued for v7.2-rc.


- Paul



More information about the linux-riscv mailing list