From: Xi Ruoyao <xry111@xry111.site>
To: "Alexandre Ghiti" <alex@ghiti.fr>,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Nathan Chancellor" <nathan@kernel.org>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>, Guo Ren <guoren@kernel.org>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] RISC-V: vDSO: Wire up getrandom() vDSO implementation
Date: Tue, 03 Jun 2025 20:48:15 +0800 [thread overview]
Message-ID: <0f0eb024d7ed062141a8aa048017e6f7ef7c1fd4.camel@xry111.site> (raw)
In-Reply-To: <71f093d5-4823-4bc6-b9ee-23433bd8c60c@ghiti.fr>
On Fri, 2025-05-23 at 12:06 +0200, Alexandre Ghiti wrote:
> On 5/23/25 10:02, Xi Ruoyao wrote:
> > On Fri, 2025-05-23 at 10:01 +0200, Alexandre Ghiti wrote:
> > > Hi Xi,
> > >
> > > On 4/11/25 10:04, Thomas Weißschuh wrote:
> > > > On Fri, Apr 11, 2025 at 10:46:00AM +0800, Xi Ruoyao wrote:
> > > > > Hook up the generic vDSO implementation to the generic vDSO
> > > > > getrandom
> > > > > implementation by providing the required
> > > > > __arch_chacha20_blocks_nostack
> > > > > and getrandom_syscall implementations. Also wire up the selftests.
> > > > >
> > > > > The benchmark result:
> > > > >
> > > > > vdso: 25000000 times in 2.466341333 seconds
> > > > > libc: 25000000 times in 41.447720005 seconds
> > > > > syscall: 25000000 times in 41.043926672 seconds
> > > > >
> > > > > vdso: 25000000 x 256 times in 162.286219353 seconds
> > > > > libc: 25000000 x 256 times in 2953.855018685 seconds
> > > > > syscall: 25000000 x 256 times in 2796.268546000 seconds
> > > > >
> > > > > Signed-off-by: Xi Ruoyao <xry111@xry111.site>
> > > > > ---
> > > > >
> > > > > [v1]->v2:
> > > > > - Fix the commit message.
> > > > > - Only build the vDSO getrandom code if CONFIG_VDSO_GETRANDOM, to
> > > > > unbreak RV32 build.
> > > > > - Likewise, only enable the selftest if __riscv_xlen == 64.
> > > > >
> > > > > [v1]:
> > > > > https://lore.kernel.org/all/20250224122541.65045-1-xry111@xry111.site/
> > > > >
> > > > > arch/riscv/Kconfig | 1 +
> > > > > arch/riscv/include/asm/vdso/getrandom.h | 30 +++
> > > > > arch/riscv/kernel/vdso/Makefile | 12 +
> > > > > 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, 300 insertions(+)
> > > > > 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
> > > > <snip>
> > > >
> > > > > diff --git a/arch/riscv/kernel/vdso/vdso.lds.S
> > > > > b/arch/riscv/kernel/vdso/vdso.lds.S
> > > > > index 8e86965a8aae..abc69cda0445 100644
> > > > > --- a/arch/riscv/kernel/vdso/vdso.lds.S
> > > > > +++ b/arch/riscv/kernel/vdso/vdso.lds.S
> > > > > @@ -80,6 +80,7 @@ VERSION
> > > > > #ifndef COMPAT_VDSO
> > > > > __vdso_riscv_hwprobe;
> > > > > #endif
> > > > > + __vdso_getrandom;
> > > > For consistency this could be gated behind CONFIG_VDSO_GETRANDOM.
> > >
> > > Nathan sent a fix for this here:
> > >
> > > https://lore.kernel.org/all/20250423-riscv-fix-compat_vdso-lld-v2-1-b7bbbc244501@kernel.org/
> > I've given it an R-b. Do you prefer me to squash the patches and keep
> > the SoB of both I and Nathan?
>
> Hmm I was about to send a new PR today after the CI passes, I mentioned
> Nathan's patch in the squash so he keeps credit for the fix. Unless you
> can send something today, I'll keep my squashed patch.
Palmer has reverted this in for-next and Thomas just informed me another
mistake in the code at https://lore.kernel.org/all/20250603-loongarch-
vdso-syscall-v1-1-6d12d6dfbdd0@linutronix.de/.
I'll try to sort things up and send v3 in the week.
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
next prev parent reply other threads:[~2025-06-03 12:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-11 2:46 Xi Ruoyao
2025-04-11 8:04 ` Thomas Weißschuh
2025-05-23 8:01 ` Alexandre Ghiti
2025-05-23 8:02 ` Xi Ruoyao
2025-05-23 10:06 ` Alexandre Ghiti
2025-06-03 12:48 ` Xi Ruoyao [this message]
2025-06-04 11:45 ` Alexandre Ghiti
2025-06-04 15:09 ` [PATCH] RISC-V: vDSO: Correct inline assembly constraints in the getrandom syscall wrapper Xi Ruoyao
2025-06-05 7:15 ` Thomas Weißschuh
2025-06-06 9:24 ` [PATCH v2] " Xi Ruoyao
2025-06-06 9:50 ` Thomas Weißschuh
2025-06-06 22:01 ` Vineet Gupta
2025-06-07 14:16 ` Xi Ruoyao
2025-06-10 7:11 ` Thomas Weißschuh
2025-06-10 8:15 ` Alexandre Ghiti
2025-06-12 20:10 ` patchwork-bot+linux-riscv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0f0eb024d7ed062141a8aa048017e6f7ef7c1fd4.camel@xry111.site \
--to=xry111@xry111.site \
--cc=Jason@zx2c4.com \
--cc=alex@ghiti.fr \
--cc=guoren@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=nathan@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=thomas.weissschuh@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®