From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"patches@lists.linux.dev" <patches@lists.linux.dev>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
Carlos O'Donell <carlos@redhat.com>
Subject: Re: [PATCH v4 2/3] random: introduce generic vDSO getrandom() implementation
Date: Sat, 19 Nov 2022 00:55:02 +0100 [thread overview]
Message-ID: <Y3gbVorxZyb4SBJa@zx2c4.com> (raw)
In-Reply-To: <ecfd265b-49e7-79b2-1818-e08a2c652db0@csgroup.eu>
Hi Christophe,
On Fri, Nov 18, 2022 at 07:34:26PM +0000, Christophe Leroy wrote:
> > +static __always_inline ssize_t
> > +__cvdso_getrandom(void *buffer, size_t len, unsigned int flags, void *opaque_state)
> > +{
> > + struct vgetrandom_state *state = opaque_state;
> > + const struct vdso_rng_data *rng_info = __arch_get_vdso_rng_data();
>
> In order to ease wiring up to powerpc, can it be done the same way as
> commit e876f0b69dc9 ("lib/vdso: Allow architectures to provide the vdso
> data pointer")
It is already. At least I think it is, unless I'm missing a subtle
distinction? The call to __arch_get_vdso_rng_data() goes to
arch-specific code, implemented in the 3/3 of this patch set for x86
inside of arch/x86/include/asm/vdso/getrandom.h. On powerpc, you'd make
a powerpc-specific __arch_get_vdso_rng_data() instead of
arch/powerpc/include/asm/vdso/getrandom.h.
Or maybe I'm not reading that commit right? The commit message says
something about __arch_get_vdso_rng_data() being problematic because of
clobbering a register, but then the same commit still seems to call
__arch_get_vdso_rng_data()? Is this one of those things where what you'd
prefer is that I define an inline function, __cvdso_get_vdso_rng_data(),
that by default calls __arch_get_vdso_rng_data(), but can be overridden
on powerpc to do some other type of magic? But
__arch_get_vdso_rng_data() is already an overiddable inline, so what
would the difference be?
Sorry if I'm a bit slow here to grok what's up.
Jason
next prev parent reply other threads:[~2022-11-19 0:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 17:28 [PATCH v4 0/3] implement getrandom() in vDSO Jason A. Donenfeld
2022-11-18 17:28 ` [PATCH v4 1/3] random: add vgetrandom_alloc() syscall Jason A. Donenfeld
2022-11-19 0:20 ` Jason A. Donenfeld
2022-11-18 17:28 ` [PATCH v4 2/3] random: introduce generic vDSO getrandom() implementation Jason A. Donenfeld
2022-11-18 19:34 ` Christophe Leroy
2022-11-18 23:55 ` Jason A. Donenfeld [this message]
2022-11-19 0:04 ` Jason A. Donenfeld
2022-11-19 7:51 ` Christophe Leroy
2022-11-19 11:43 ` Jason A. Donenfeld
2022-11-19 12:12 ` Jason A. Donenfeld
2022-11-18 17:28 ` [PATCH v4 3/3] x86: vdso: Wire up getrandom() vDSO implementation Jason A. Donenfeld
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=Y3gbVorxZyb4SBJa@zx2c4.com \
--to=jason@zx2c4.com \
--cc=adhemerval.zanella@linaro.org \
--cc=carlos@redhat.com \
--cc=christophe.leroy@csgroup.eu \
--cc=gregkh@linuxfoundation.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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