public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Geert Uytterhoeven' <geert@linux-m68k.org>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Joshua Kinard <kumba@gentoo.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	linux-m68k <linux-m68k@lists.linux-m68k.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	"open list:BROADCOM NVRAM DRIVER" <linux-mips@vger.kernel.org>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Eric Biggers <ebiggers@google.com>,
	Ard Biesheuvel <ardb@kernel.org>, "Arnd Bergmann" <arnd@arndb.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Andy Lutomirski" <luto@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	"Lennart Poettering" <mzxreary@0pointer.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Theodore Ts'o <tytso@mit.edu>
Subject: RE: [PATCH RFC v0] random: block in /dev/urandom
Date: Mon, 14 Feb 2022 14:57:05 +0000	[thread overview]
Message-ID: <63afd299c8df4495b27456a7f92aec75@AcuMS.aculab.com> (raw)
In-Reply-To: <CAMuHMdXDj+BVCs4Syg39vjnHGKcwJnCgDxrGoOiEFM_T4ojwPg@mail.gmail.com>

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)

  reply	other threads:[~2022-02-14 14:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 21:07 [PATCH RFC v0] random: block in /dev/urandom Jason A. Donenfeld
2022-02-11 21:29 ` Linus Torvalds
2022-02-11 21:56   ` Jason A. Donenfeld
2022-02-11 22:01 ` Finn Thain
2022-02-12 23:05 ` Joshua Kinard
2022-02-12 23:13   ` Maciej W. Rozycki
2022-02-14 14:05   ` Jason A. Donenfeld
2022-02-14 14:26     ` Geert Uytterhoeven
2022-02-14 14:57       ` David Laight [this message]
2022-02-14 22:53     ` Finn Thain
2022-03-01 19:27   ` 10maurycy10
2022-02-13  3:15 ` Andy Lutomirski
2022-02-14  8:53 ` Lennart Poettering
2022-02-14 14:13   ` Jason A. Donenfeld
2022-02-14 14:53     ` Lennart Poettering

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=63afd299c8df4495b27456a7f92aec75@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=Jason@zx2c4.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=ebiggers@google.com \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=kumba@gentoo.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@dominikbrodowski.net \
    --cc=luto@kernel.org \
    --cc=mzxreary@0pointer.de \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=tytso@mit.edu \
    /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