From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Harald Freudenberger <freude@linux.ibm.com>
Cc: linux390-list@tuxmaker.boeblingen.de.ibm.com,
linux-crypto@vger.kernel.org, linux-s390@vger.kernel.org,
jchrist@linux.ibm.com, dengler@linux.ibm.com
Subject: Re: [PATCH] s390/archrandom: remove CPACF trng invocations in interrupt context
Date: Tue, 12 Jul 2022 16:44:30 +0200 [thread overview]
Message-ID: <Ys2IzgYW4FHTHiu3@zx2c4.com> (raw)
In-Reply-To: <ac816519f9d8f4948434acb0db631041@linux.ibm.com>
Hi Harald,
On Tue, Jul 12, 2022 at 04:35:41PM +0200, Harald Freudenberger wrote:
> On 2022-07-12 14:27, Jason A. Donenfeld wrote:
> > Hi Harald,
> >
> > On Tue, Jul 12, 2022 at 02:09:35PM +0200, Harald Freudenberger wrote:
> >> > You've gone through the troubles of confirming experimentally what
> >> > in_task() does, but that doesn't answer *why* it should be disallowed
> >> > variously in each one of these contexts.
> >>
> >> I think, I showed this. The only real occurrences remaining for the
> >> arch_get_random_seed_long() call is within softirq context when the
> >> network layer tries to allocate some skb buffers. My personal feeling
> >> about this is that it does not hurt - but I asked our network guys
> >> and their feedback is clear: no way - every delay there may cause
> >> high bandwidth traffic to stumble and this is to be absolutely
> >> avoided.
> >> However, they can't give me any measurements.
> >>
> >> So yes, the intention is now with checking for in_task() to prevent
> >> the trng call in hard and soft interrupt context. But still I'd like
> >> to meet your condition to provide good random at kernel startup.
> >
> > That's too bad, but okay.
> >
> > Final question: do you see any of the in_task() vs in_whatever()
> > semantics changing if arch_get_random_words{,_seed}() is ever
> > implemented, which would reduce the current multitude of calls to the
> > trng to a single call?
> >
> > Jason
>
> Hm, no, I can't see a way to provide trng random data in any whatever
> interrupt context for the next future. The only enabler would be to
> use a buffer ... I started to get in contact with our hardware guys
> to make the trng data internally buffered and this the invocation
> could be in no time give back random data. But this may be a
> hardware development thing for the next machine generation.
Alrightie then. Well, I'll Ack a v2 that keeps the _int variant. Sounds
like then we'll be done here.
Tangential topic: would be nice to add the TRNG instruction to QEMU's
TCG so that VMs in CI have a bit of randomness available.
Jason
prev parent reply other threads:[~2022-07-12 14:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-12 10:08 [PATCH] s390/archrandom: remove CPACF trng invocations in interrupt context Harald Freudenberger
2022-07-12 10:23 ` Jason A. Donenfeld
2022-07-12 12:09 ` Harald Freudenberger
2022-07-12 12:27 ` Jason A. Donenfeld
2022-07-12 14:35 ` Harald Freudenberger
2022-07-12 14:44 ` Jason A. Donenfeld [this message]
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=Ys2IzgYW4FHTHiu3@zx2c4.com \
--to=jason@zx2c4.com \
--cc=dengler@linux.ibm.com \
--cc=freude@linux.ibm.com \
--cc=jchrist@linux.ibm.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux390-list@tuxmaker.boeblingen.de.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).