[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <63afd299c8df4495b27456a7f92aec75@AcuMS.aculab.com>
Date: Mon, 14 Feb 2022 14:57:05 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Geert Uytterhoeven' <geert@...ux-m68k.org>,
"Jason A. Donenfeld" <Jason@...c4.com>
CC: Joshua Kinard <kumba@...too.org>,
LKML <linux-kernel@...r.kernel.org>,
Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
linux-riscv <linux-riscv@...ts.infradead.org>,
linux-m68k <linux-m68k@...ts.linux-m68k.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
"open list:BROADCOM NVRAM DRIVER" <linux-mips@...r.kernel.org>,
Dominik Brodowski <linux@...inikbrodowski.net>,
Eric Biggers <ebiggers@...gle.com>,
Ard Biesheuvel <ardb@...nel.org>,
"Arnd Bergmann" <arnd@...db.de>,
Thomas Gleixner <tglx@...utronix.de>,
"Andy Lutomirski" <luto@...nel.org>,
Kees Cook <keescook@...omium.org>,
"Lennart Poettering" <mzxreary@...inter.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Theodore Ts'o <tytso@....edu>
Subject: RE: [PATCH RFC v0] random: block in /dev/urandom
From: Geert Uytterhoeven
> Sent: 14 February 2022 14:26
...
> I'm afraid you missed one important detail. You wrote:
>
> > On every platform, random_get_entropy() is connected to get_cycles(),
> > except for three: m68k, MIPS, and RISC-V.
>
> The default implementation in include/asm-generic/timex.h is:
>
> static inline cycles_t get_cycles(void)
> {
> return 0;
> }
>
> Several architectures do not implement get_cycles(), or implement it
> with a variant that's very similar or identical to the generic version.
Add to the list nios2 and old x86 (I think rdtsc is a pentium instruction)
I can't see it in my 386 book, and i don't think 486 added it.
I'm not sure if/when sparc added one.
I don't remember it being there in the late 1980s.
nios2 (soft cpu on Altera/Intel fpga) is annoying.
There is a 'read control register' instruction and plenty of space ones.
But you can't define your own and one isn't a clock counter.
You can add one as the result of a custom instruction.
(Even the same custom instruction that does byteswap.)
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists