[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.2204241140290.9383@angie.orcam.me.uk>
Date: Sun, 24 Apr 2022 11:51:38 +0100 (BST)
From: "Maciej W. Rozycki" <macro@...am.me.uk>
To: "Jason A. Donenfeld" <Jason@...c4.com>
cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
LKML <linux-kernel@...r.kernel.org>,
Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Arnd Bergmann <arnd@...db.de>, Theodore Ts'o <tytso@....edu>,
Dominik Brodowski <linux@...inikbrodowski.net>,
Russell King <linux@...linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
"David S . Miller" <davem@...emloft.net>,
Richard Weinberger <richard@....at>,
Anton Ivanov <anton.ivanov@...bridgegreys.com>,
Johannes Berg <johannes@...solutions.net>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H . Peter Anvin" <hpa@...or.com>, Chris Zankel <chris@...kel.net>,
Max Filippov <jcmvbkbc@...il.com>,
John Stultz <john.stultz@...aro.org>,
Stephen Boyd <sboyd@...nel.org>,
Dinh Nguyen <dinguyen@...nel.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
linux-m68k <linux-m68k@...ts.linux-m68k.org>,
"open list:BROADCOM NVRAM DRIVER" <linux-mips@...r.kernel.org>,
linux-riscv <linux-riscv@...ts.infradead.org>,
sparclinux@...r.kernel.org, linux-um@...ts.infradead.org,
X86 ML <x86@...nel.org>, linux-xtensa@...ux-xtensa.org
Subject: Re: [PATCH v4 04/11] mips: use fallback for random_get_entropy()
instead of zero
On Sun, 24 Apr 2022, Jason A. Donenfeld wrote:
> > unconditionally. I think this discovery asks for code optimisation, which
> > I'll try to cook up sometime.
>
> At some point too, by the way, we might also consider putting that into
> a .c file rather than a static inline in the .h, since that function is
> starting to get sort of big.
This code is supposed to produce one to a couple of machine instructions
for the majority of configurations. This is because the conditionals used
are usually compile-time constants. Therefore I think it will be good to
continue having it as `static inline' functions. Cf. the analysis in
commit 06947aaaf9bf ("MIPS: Implement random_get_entropy with CP0
Random").
If this code does expand to a longer sequence for some platforms, then
either they need to be verified whether they can be optimised (just as I
note here for the DEC systems) or we can consider making these functions
`extern inline' instead, with out-of-line code available from a .a file in
case the compiler decides the code is too large for inlining to be worth
doing after all. Though I don't expect the latter case to be required
really.
Maciej
Powered by blists - more mailing lists