Re: [PATCH] random: make try_to_generate_entropy() more robust

2019-10-19 Thread Jörn Engel
On Sat, Oct 19, 2019 at 12:49:52PM +0200, Thomas Gleixner wrote: > > One slightly related thing I was looking into is that the mixing of > interrupt entropy is always done from hard interrupt context. That has a > few issues: > > 1) It's pretty visible in profiles for high frequency interrupt

Re: [PATCH] random: make try_to_generate_entropy() more robust

2019-10-19 Thread Thomas Gleixner
On Fri, 18 Oct 2019, Linus Torvalds wrote: > On Fri, Oct 18, 2019 at 4:42 PM Jörn Engel wrote: > > > > We can generate entropy on almost any CPU, even if it doesn't provide a > > high-resolution timer for random_get_entropy(). As long as the CPU is > > not idle, it changed the register file every

Re: [PATCH] random: make try_to_generate_entropy() more robust

2019-10-19 Thread Thomas Gleixner
On Sat, 19 Oct 2019, Ingo Molnar wrote: > * Linus Torvalds wrote: > > On Fri, Oct 18, 2019 at 4:42 PM Jörn Engel wrote: > > But from a softirq or threaded irq context that 'interrupted' regs > context might potentially be NULL. > > NULL isn't a good thing to pass to mix_pool_bytes(), because t

Re: [PATCH] random: make try_to_generate_entropy() more robust

2019-10-19 Thread Ingo Molnar
* Linus Torvalds wrote: > On Fri, Oct 18, 2019 at 4:42 PM Jörn Engel wrote: > > > > We can generate entropy on almost any CPU, even if it doesn't provide a > > high-resolution timer for random_get_entropy(). As long as the CPU is > > not idle, it changed the register file every few cycles. A

Re: [PATCH] random: make try_to_generate_entropy() more robust

2019-10-18 Thread Linus Torvalds
On Fri, Oct 18, 2019 at 4:42 PM Jörn Engel wrote: > > We can generate entropy on almost any CPU, even if it doesn't provide a > high-resolution timer for random_get_entropy(). As long as the CPU is > not idle, it changed the register file every few cycles. As long as the > ALU isn't fully synchr

Re: [PATCH] random: make try_to_generate_entropy() more robust

2019-10-18 Thread Linus Torvalds
On Fri, Oct 18, 2019 at 4:42 PM Jörn Engel wrote: > > Sorry for coming late to the discussion. I generally like the approach > in try_to_generate_entropy(), but I think we can do a little better > still. Would something like this work? Hmm. I'm not convinced that the register set is all that ra

Re: [PATCH] random: make try_to_generate_entropy() more robust

2019-10-18 Thread Jörn Engel
. > From 90078333edb6e720f13f6668376a69c0f9c570f5 Mon Sep 17 00:00:00 2001 > From: Joern Engel > Date: Fri, 18 Oct 2019 13:25:52 -0700 > Subject: [PATCH] random: make try_to_generate_entropy() more robust > > We can generate entropy on almost any CPU, even if it doesn't provide a > high-reso