All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com>
Cc: Torsten Duwe <duwe@suse.de>,
	linux-kernel@vger.kernel.org, geralds@linux.vnet.ibm.com,
	heicars2@linux.vnet.ibm.com, mschwid2@linux.vnet.ibm.com,
	Matt Mackall <mpm@selenic.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Harald Freudenberger <FREUDE@de.ibm.com>
Subject: Re: [Patch v5.1 03/03]: hwrng: khwrngd derating per device
Date: Fri, 11 Jul 2014 10:42:15 -0400	[thread overview]
Message-ID: <20140711144215.GA26426@thunk.org> (raw)
In-Reply-To: <OF8E5D9F84.46724386-ONC1257D12.00431C2E-C1257D12.004B5DCC@de.ibm.com>

On Fri, Jul 11, 2014 at 03:43:24PM +0200, Ingo Tuchscherer wrote:
> At this point in time the zcrypt hw device is not registered completely in
> the internal zcrypt device list (ap_device_list). The crypto card itself is
> initialized and ready to receive and service requests, but the tasklet that
> retrieve the card response is not able to find the device because it's not
> yet in the list. Finally the response would not be received and the thread
> is still waiting for completion, hence the probing/registering procedure
> for all the other crypto devices is blocked. No further devices could be
> scanned, initialized and registered.
> Therefore I would not recommend to trigger a hw device request before the
> device register process has completed.

Is there any chance that you could change the zcrypt driver so that it
doesn't call hwrng_register() until and the tasklet that can receive
the request has been fully registered?  It sounds like that should
just be a matter of reordering a few lines of code, no?

> Anyway, when the kernel thread (hwrng_fillfn) starts, it take care about
> the initial call to the zcrypt rng device to be triggered. Therefore I
> don't see any reason to manually call rng_get_data() during the
> registration or did I missed something?

The basic idea was described in the commit that added this:

commit d9e79726193346569af7953369a638ee2275ade5
Author: Kees Cook <keescook@chromium.org>
Date:   Mon Mar 3 15:51:48 2014 -0800

    hwrng: add randomness to system from rng sources
    
    When bringing a new RNG source online, it seems like it would make sense
    to use some of its bytes to make the system entropy pool more random,
    as done with all sorts of other devices that contain per-device or
    per-boot differences.
    
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Reviewed-by: Jason Cooper <jason@lakedaemon.net>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Cheers,

						- Ted

  reply	other threads:[~2014-07-11 14:42 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 14:29 [PATCH v2 00/03]: khwrngd Torsten Duwe
2014-03-21 14:32 ` [Patch v2 01/03]: provide an injection point for pure hardware randomness Torsten Duwe
2014-03-21 14:33 ` [PATCH v2 02/03]: hwrng: create filler thread Torsten Duwe
2014-03-27  0:50   ` Andy Lutomirski
2014-03-27  1:03     ` H. Peter Anvin
2014-03-27  1:11       ` Andy Lutomirski
2014-03-27  1:55         ` H. Peter Anvin
2014-03-27  4:47         ` H. Peter Anvin
2014-03-27 15:03           ` Torsten Duwe
2014-03-27 16:06           ` Andy Lutomirski
2014-03-27 14:54       ` Torsten Duwe
2014-03-27 15:47         ` Andy Lutomirski
2014-04-14 16:02       ` [PATCH v3 00/03]: hwrng: an in-kernel rngd Torsten Duwe
2014-04-14 16:04         ` [PATCH v3 01/03]: hwrng: provide an injection point for pure hardware randomness Torsten Duwe
2014-04-14 16:05         ` [PATCH v3 02/03]: hwrng: create filler thread Torsten Duwe
2014-04-14 16:06         ` [PATCH v3 03/03]: hwrng: khwrngd derating per device Torsten Duwe
2014-04-14 16:41           ` Andy Lutomirski
2014-04-15  8:51             ` Torsten Duwe
2014-04-15 16:53               ` Andy Lutomirski
2014-05-27 13:41                 ` [PATCH v5 00/03]: hwrng: an in-kernel rngd Torsten Duwe
2014-05-27 13:44                   ` [Patch 01/03]: provide an injection point for pure hardware randomness Torsten Duwe
2014-05-27 13:45                   ` [Patch v5 02/03]: hwrng: create filler thread Torsten Duwe
2014-05-27 13:46                   ` [Patch v5 03/03]: hwrng: khwrngd derating per device Torsten Duwe
2014-05-27 14:11                     ` [Patch v5.1 " Torsten Duwe
2014-06-12  1:24                       ` H. Peter Anvin
2014-06-12 10:09                         ` Torsten Duwe
2014-06-14  2:40                           ` Theodore Ts'o
2014-06-14  2:44                             ` H. Peter Anvin
2014-06-15  5:11                               ` Theodore Ts'o
2014-06-16  7:31                                 ` Torsten Duwe
2014-06-16 11:22                                   ` Theodore Ts'o
2014-06-16 14:07                                     ` Torsten Duwe
2014-06-16 14:40                                       ` Theodore Ts'o
     [not found]                                     ` <20140616141444.GB1744@suse.de>
     [not found]                                       ` <20140616142812.GB19387@thunk.org>
2014-07-11 13:43                                         ` Ingo Tuchscherer
2014-07-11 14:42                                           ` Theodore Ts'o [this message]
2014-04-14 16:09         ` [PATCH v3 00/03]: hwrng: an in-kernel rngd H. Peter Anvin
2014-04-14 16:24           ` Torsten Duwe
2014-04-14 16:29             ` H. Peter Anvin
2014-04-14 16:43             ` Andy Lutomirski
2014-04-14 16:27           ` [PATCH v4 03/03]: hwrng: khwrngd derating per device Torsten Duwe
2014-03-21 14:34 ` [PATCH v2 " Torsten Duwe

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=20140711144215.GA26426@thunk.org \
    --to=tytso@mit.edu \
    --cc=FREUDE@de.ibm.com \
    --cc=duwe@suse.de \
    --cc=geralds@linux.vnet.ibm.com \
    --cc=heicars2@linux.vnet.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=ingo.tuchscherer@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=mschwid2@linux.vnet.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.