public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB•COM>
To: "'Jason A. Donenfeld'" <Jason@zx2c4•com>, Borislav Petkov <bp@suse•de>
Cc: Mark Rutland <mark.rutland@arm•com>,
	"linux-s390@vger•kernel.org" <linux-s390@vger•kernel.org>,
	Catalin Marinas <catalin.marinas@arm•com>,
	"linuxppc-dev@lists•ozlabs.org" <linuxppc-dev@lists•ozlabs.org>,
	Heiko Carstens <hca@linux•ibm.com>,
	"x86@kernel•org" <x86@kernel•org>,
	"linux-kernel@vger•kernel.org" <linux-kernel@vger•kernel.org>,
	Johannes Berg <johannes@sipsolutions•net>,
	Harald Freudenberger <freude@linux•ibm.com>,
	"H . Peter Anvin" <hpa@zytor•com>,
	Alexander Gordeev <agordeev@linux•ibm.com>,
	Will Deacon <will@kernel•org>,
	Thomas Gleixner <tglx@linutronix•de>,
	"linux-arm-kernel@lists•infradead.org"
	<linux-arm-kernel@lists•infradead.org>
Subject: RE: [PATCH v3] random: handle archrandom with multiple longs
Date: Mon, 25 Jul 2022 09:36:34 +0000	[thread overview]
Message-ID: <10561a841a7342c882aabb0fbdbfc762@AcuMS.aculab.com> (raw)
In-Reply-To: <Yt5hwxC1xgvA8Asw@zx2c4.com>

...
> More directly, the reason we don't want to error is because the use case
> has fallbacks meant to handle errors. The cascade looks like this
> (quoting from the other email):
> 
>     unsigned long array[whatever];
>     for (i = 0; i < ARRAY_SIZE(array);) {
>         longs = arch_get_random_seed_longs(&array[i], ARRAY_SIZE(array) - i);
>         if (longs) {
>             i += longs;
>             continue;
>         }
>         longs = arch_get_random_longs(&array[i], ARRAY_SIZE(array) - i);
>         if (longs) {
>             i += longs;
>             continue;
>         }
>         array[i++] = random_get_entropy();
>     }
> 
> It tries to get the best that it can as much as it can, but isn't going
> to block or do anything too nuts for that.

Do you really want to retry the earlier calls that returned no data?

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  reply	other threads:[~2022-07-25  9:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <YtP1+MJ1tNdJA60l@zx2c4.com>
2022-07-17 20:03 ` [PATCH v2] random: handle archrandom in plural words Jason A. Donenfeld
2022-07-18  6:31   ` Michael Ellerman
2022-07-18  6:46     ` Gabriel Paubert
2022-07-20  3:03       ` Michael Ellerman
2022-07-19 12:42   ` Mark Rutland
2022-07-19 12:46     ` Jason A. Donenfeld
2022-07-19 13:02       ` [PATCH v3] random: handle archrandom with multiple longs Jason A. Donenfeld
2022-07-19 13:17         ` Mark Rutland
2022-07-19 13:48         ` Catalin Marinas
2022-07-22 12:06         ` Heiko Carstens
2022-07-25  9:19         ` Borislav Petkov
2022-07-25  9:26           ` Jason A. Donenfeld
2022-07-25  9:36             ` David Laight [this message]
2022-07-25  9:37               ` Jason A. Donenfeld
2022-07-25 11:25         ` Borislav Petkov
2022-08-01 14:46         ` Harald Freudenberger
2022-08-01 14:50           ` Jason A. Donenfeld
2022-07-22  8:08   ` [PATCH v2] random: handle archrandom in plural words Holger Dengler
2022-07-22 11:22     ` Jason A. Donenfeld
2022-08-03 12:01       ` Holger Dengler

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=10561a841a7342c882aabb0fbdbfc762@AcuMS.aculab.com \
    --to=david.laight@aculab$(echo .)com \
    --cc=Jason@zx2c4$(echo .)com \
    --cc=agordeev@linux$(echo .)ibm.com \
    --cc=bp@suse$(echo .)de \
    --cc=catalin.marinas@arm$(echo .)com \
    --cc=freude@linux$(echo .)ibm.com \
    --cc=hca@linux$(echo .)ibm.com \
    --cc=hpa@zytor$(echo .)com \
    --cc=johannes@sipsolutions$(echo .)net \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-s390@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=mark.rutland@arm$(echo .)com \
    --cc=tglx@linutronix$(echo .)de \
    --cc=will@kernel$(echo .)org \
    --cc=x86@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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