Re: x86/random: Speculation to the rescue

From: Linus Torvalds
Date: Sun Oct 06 2019 - 14:27:19 EST


On Sun, Oct 6, 2019 at 11:21 AM Pavel Machek <pavel@xxxxxx> wrote:
>
>
> Even without cycle counter... if we _know_ we are trying to generate
> entropy and have MMC available, we don't care about power and
> performance.
>
> So we can just...
>
> issue read request on MMC
> while (!interrupt_done)
> i++
>
> ...and then use i++ as poor man's version of cycle counter.
>
> [We would not want to do that in normal operation, for obvious
> reasons, just when userland is blocked and waiting for entropy.]
>
> Hmm?

I hate it, but it might be worth it for the existing timer thing
alternative when we don't have a cycle counter.

Then we'd have _something_ for those bad embedded devices.

I still absolutely hate the idea of doing disk IO for this.

Linus