[PATCH] riscv: vdso: Define BUILD_VDSO
Guo Ren
guoren at kernel.org
Mon Nov 23 19:07:00 PST 2026
On Tue, Nov 24, 2026 at 2:45 AM Han Gao via B4 Relay
<devnull+gaohan.iscas.ac.cn at kernel.org> wrote:
>
> 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
This doesn't need to be separate from the original patch—I'll fold it
into the new version.
--
Best Regards
Guo Ren
More information about the linux-riscv
mailing list