From: Herbert Xu <herbert@gondor.apana.org.au>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: linux-kernel@vger.kernel.org, Matt Mackall <mpm@selenic.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
matthias.bgg@gmail.com, Liam.Merwick@oracle.com,
Jim.Quigley@oracle.com, linux-crypto@vger.kernel.org,
Cornelia Huck <cornelia.huck@de.ibm.com>,
dgilbert@redhat.com
Subject: Re: [PATCH] hwrng: document the quality field
Date: Fri, 5 Oct 2018 10:27:16 +0800 [thread overview]
Message-ID: <20181005022716.ljqj3kkgu3osntia@gondor.apana.org.au> (raw)
In-Reply-To: <20180925162924.378725-1-mst@redhat.com>
On Tue, Sep 25, 2018 at 12:35:18PM -0400, Michael S. Tsirkin wrote:
> quality field is currently documented as being 'per mill'. In fact the
> math involved is:
>
> add_hwgenerator_randomness((void *)rng_fillbuf, rc,
> rc * current_quality * 8 >> 10);
>
> thus the actual definition is "bits of entropy per 1024 bits of input".
>
> The current documentation seems to have confused multiple people
> in the past, let's fix the documentation to match code.
>
> An alternative is to change core to match driver expectations, replacing
> rc * current_quality * 8 >> 10
> with
> rc * current_quality / 1000
> but that has performance costs, so probably isn't a good option.
>
> Fixes: 0f734e6e768 ("hwrng: add per-device entropy derating")
> Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>
>
> drivers/char/hw_random/core.c | 4 ++--
> include/linux/hw_random.h | 3 ++-
> 2 files changed, 4 insertions(+), 3 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
prev parent reply other threads:[~2018-10-05 2:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-25 16:35 [PATCH] hwrng: document the quality field Michael S. Tsirkin
2018-10-05 2:27 ` Herbert Xu [this message]
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=20181005022716.ljqj3kkgu3osntia@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=Jim.Quigley@oracle.com \
--cc=Liam.Merwick@oracle.com \
--cc=arnd@arndb.de \
--cc=cornelia.huck@de.ibm.com \
--cc=dgilbert@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=mpm@selenic.com \
--cc=mst@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).