[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHmME9p_9j_B2d1h3cKVbv=ucNAa9_grBBW_jdWa8GTbm5WpZg@mail.gmail.com>
Date: Mon, 25 Jul 2022 11:37:23 +0200
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: David Laight <David.Laight@...lab.com>
Cc: Borislav Petkov <bp@...e.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>, Will Deacon <will@...nel.org>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Thomas Gleixner <tglx@...utronix.de>,
"H . Peter Anvin" <hpa@...or.com>,
Catalin Marinas <catalin.marinas@....com>,
Heiko Carstens <hca@...ux.ibm.com>,
Johannes Berg <johannes@...solutions.net>,
Mark Rutland <mark.rutland@....com>,
Harald Freudenberger <freude@...ux.ibm.com>,
Michael Ellerman <mpe@...erman.id.au>
Subject: Re: [PATCH v3] random: handle archrandom with multiple longs
On Mon, Jul 25, 2022 at 11:36 AM David Laight <David.Laight@...lab.com> wrote:
>
> ...
> > 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?
Does the above code do that?
Powered by blists - more mailing lists