[RFC PATCH 1/1] riscv: add Kconfig.vdso

Zhangjin Wu falcon at tinylab.org
Mon Oct 2 23:39:31 PDT 2023


Hi, Palmer

Thanks very much for your review.

> On Thu, 18 May 2023 10:48:52 PDT (-0700), falcon at tinylab.org wrote:
> > Allow users to disable the vdso and compat vdso in Kconfig.
> >
> > Copied and adapted some code from arm and arm64.
> >
> > Size measured with a small rv64 config of v6.4-rc2:
> >
> >             Config | Size      | Shrink
> >     ---------------|-----------|--------
> >            default | 1588 KB   |
> >     no compat vdso | 1584 KB   | -4 KB
> >      (and) no vdso | 1576 KB   | -12 KB
> 
> Do the resulting kernels actually work?  As far as I can tell this 
> disables some syscalls that would break userspace (that time-related 
> stuff that would be turned off) and the lack of rt_sigreturn would need 
> an executable stack (which probably cancels out any benefits from the 
> smaller text size).
>

Yes, its working is limited in extremely small embedded systems (who
don't require such syscalls or their vdso speedup variants), the libc we
currently tested is NoLibc.

This is part of our work on kernel tinification for RISC-V, exactly, it
is derived from the in-progress DCE/DSE work [1].

The simple background logic here is if the target system don't require a target
syscall, no need to provide both the syscall and/or its vdso variants from
kernel side.  seems this logic is not specific to RISC-V, perhaps we should
rethink it under the whole DSE work (Arnd has given some suggestions), for
example, let the DSE 'framework' (based on user-space profiling) tell us which
vdso variants should be reserved and which one is not required, manual
selection is really not that friendly although ARM also currently provide the
same config option.

Thanks,
Zhangjin Wu
---
[1]: https://lore.kernel.org/lkml/cover.1695679700.git.falcon@tinylab.org/



More information about the linux-riscv mailing list