[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <69007e7142414d281617c1edb7444b18f53fd1f0.camel@xry111.site>
Date: Mon, 24 Feb 2025 22:10:00 +0800
From: Xi Ruoyao <xry111@...111.site>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Cc: "Jason A. Donenfeld" <Jason@...c4.com>, Paul Walmsley
<paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>, Guo Ren
<guoren@...nel.org>, linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] RISC-V: vDSO: Wire up getrandom() vDSO implementation
On Mon, 2025-02-24 at 15:07 +0100, Thomas Weißschuh wrote:
> Hi!
>
> On Mon, Feb 24, 2025 at 08:25:41PM +0800, Xi Ruoyao wrote:
> > Hook up the generic vDSO implementation to the LoongArch vDSO data
> > page
>
> LoongArch?
Oops, pasto by "reusing" my own words in LoongArch commit :(.
> "to the generic vDSO getrandom implementation"
>
> > by providing the required __arch_chacha20_blocks_nostack,
> > __arch_get_k_vdso_rng_data, and getrandom_syscall implementations.
> > Also
> > wire up the selftests.
> >
> > The benchmark result:
> >
> > vdso: 25000000 times in 2.560024913 seconds
> > libc: 25000000 times in 40.960524767 seconds
> > syscall: 25000000 times in 40.380651864 seconds
> >
> > vdso: 25000000 x 256 times in 171.830655321 seconds
> > libc: 25000000 x 256 times in 2913.107080132 seconds
> > syscall: 25000000 x 256 times in 2692.084323377 seconds
> >
> > Note that it depends on Thomas Weißschuh's vDSO generic data storage
> > implementation (now in the timers/vdso branch of tip).
>
> The note should be below a "---" line, so it doesn't end up in the
> commit.
>
> > Signed-off-by: Xi Ruoyao <xry111@...111.site>
> > ---
> > arch/riscv/Kconfig | 1 +
> > arch/riscv/include/asm/vdso/getrandom.h | 30 +++
> > arch/riscv/kernel/vdso/Makefile | 7 +-
> > arch/riscv/kernel/vdso/getrandom.c | 10 +
> > arch/riscv/kernel/vdso/vdso.lds.S | 1 +
> > arch/riscv/kernel/vdso/vgetrandom-chacha.S | 244
> > ++++++++++++++++++
> > .../selftests/vDSO/vgetrandom-chacha.S | 2 +
> > 7 files changed, 294 insertions(+), 1 deletion(-)
> > create mode 100644 arch/riscv/include/asm/vdso/getrandom.h
> > create mode 100644 arch/riscv/kernel/vdso/getrandom.c
> > create mode 100644 arch/riscv/kernel/vdso/vgetrandom-chacha.S
> >
> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> > index aa8ea53186c0..6fdd63e15fb4 100644
> > --- a/arch/riscv/Kconfig
> > +++ b/arch/riscv/Kconfig
> > @@ -213,6 +213,7 @@ config RISCV
> > select THREAD_INFO_IN_TASK
> > select TRACE_IRQFLAGS_SUPPORT
> > select UACCESS_MEMCPY if !MMU
> > + select VDSO_GETRANDOM if HAVE_GENERIC_VDSO
>
> Broken alphabetical ordering.
I'm still investigating some CI failures (at lease some of them seem not
just caused by missing the generic data storage implementation). I'll
fix them and the errors you found in V2.
--
Xi Ruoyao <xry111@...111.site>
School of Aerospace Science and Technology, Xidian University
Powered by blists - more mailing lists