[PATCH] riscv: vdso: Define BUILD_VDSO
Han Gao via B4 Relay
devnull+gaohan.iscas.ac.cn at kernel.org
Mon Nov 23 10:44:45 PST 2026
From: Han Gao <gaohan at iscas.ac.cn>
Unlike arm64, powerpc and others, riscv does not define BUILD_VDSO
for its vDSO build, so header checks on it never apply here.
The T-Head WRITE_ONCE errata needs it to keep its alternative out of
the vDSO. Otherwise booting with CONFIG_DEBUG_VIRTUAL=y hits
VIRTUAL_BUG_ON() in vmalloc_to_page().
Link: https://lore.kernel.org/linux-riscv/CAJF2gTQ+cOYfQX=JsK6T6Aij79FU9RGuyxAAouyL958z8ABqng@mail.gmail.com/
Signed-off-by: Han Gao <gaohan at iscas.ac.cn>
---
Tested with the WRITE_ONCE errata V6 in qemu -cpu thead-c906.
---
arch/riscv/kernel/vdso/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
index c023046a3fd75a95946babb96b3f9019ee2dec4a..b99645672634852df814e9d17c768bf82297079b 100644
--- a/arch/riscv/kernel/vdso/Makefile
+++ b/arch/riscv/kernel/vdso/Makefile
@@ -35,6 +35,7 @@ endif
ccflags-y := -fno-stack-protector
ccflags-y += -DDISABLE_BRANCH_PROFILING
+ccflags-y += -DBUILD_VDSO
ccflags-y += -fno-builtin
ccflags-y += $(CONFIG_CC_OPT_INLINE_MEMSET)
ccflags-y += $(KBUILD_BASE_ISA)$(CFI_MARCH)
---
base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
change-id: 20261124-riscv-vdso-build-vdso-adbf7854af5f
Best regards,
--
Han Gao <gaohan at iscas.ac.cn>
More information about the linux-riscv
mailing list