<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/hw_random.h, branch v5.8</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.8</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.8'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2019-07-15T14:03:02Z</updated>
<entry>
<title>docs: admin-guide: add a series of orphaned documents</title>
<updated>2019-07-15T14:03:02Z</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab+samsung@kernel.org</email>
</author>
<published>2019-06-27T17:56:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4f4cfa6c560c93ba180c30675cf845e1597de44c'/>
<id>urn:sha1:4f4cfa6c560c93ba180c30675cf845e1597de44c</id>
<content type='text'>
There are lots of documents that belong to the admin-guide but
are on random places (most under Documentation root dir).

Move them to the admin guide.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
Acked-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Acked-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
</content>
</entry>
<entry>
<title>hwrng: core - document the quality field</title>
<updated>2018-10-05T02:16:56Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2018-09-25T16:35:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fae29f135ef4a86228d3ce13b61babf0d3031118'/>
<id>urn:sha1:fae29f135ef4a86228d3ce13b61babf0d3031118</id>
<content type='text'>
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 &gt;&gt; 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 &gt;&gt; 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" &lt;dgilbert@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: Make explicit that max &gt;= 32 always</title>
<updated>2016-11-21T14:50:45Z</updated>
<author>
<name>PrasannaKumar Muralidharan</name>
<email>prasannatsmkumar@gmail.com</email>
</author>
<published>2016-11-18T17:30:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ed424bb3680b6e6167a44c5c195ec8f9aea3ab3b'/>
<id>urn:sha1:ed424bb3680b6e6167a44c5c195ec8f9aea3ab3b</id>
<content type='text'>
As hw_random core calls -&gt;read with max &gt; 32 or more, make it explicit.
Also remove checks involving 'max' being less than 8.

Signed-off-by: PrasannaKumar Muralidharan &lt;prasannatsmkumar@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: core - Improve description of the -&gt;read() interface</title>
<updated>2016-08-24T13:04:48Z</updated>
<author>
<name>Daniel Thompson</name>
<email>daniel.thompson@linaro.org</email>
</author>
<published>2016-08-18T12:37:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ed0bd721c9322e8e6ee953884706080d40106a6e'/>
<id>urn:sha1:ed0bd721c9322e8e6ee953884706080d40106a6e</id>
<content type='text'>
Currently, very few RNG drivers support single byte reads using the
-&gt;read() interface. Of the 14 drivers in drivers/char/hw_random that
support this interface only three of these actually support max == 1.
The other behaviours vary between return 0, return 2, return 4 and return
-EIO).

This is not a problem in practice because the core hw_random code never
performs a read shorter than 16 bytes. The documentation for this function
already contrains the alignment of the buffer pointer, so let's also
guarantee that the buffer is at least as large as its alignment.

This constraint is intended to be the weakest guarantee neccessary to
allow driver writers to safely simplify their code.

Signed-off-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: add devm_* interfaces</title>
<updated>2015-03-16T10:45:54Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2015-03-12T21:00:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4d9b519c9bcab5718053f8717dadad7b09b41f5e'/>
<id>urn:sha1:4d9b519c9bcab5718053f8717dadad7b09b41f5e</id>
<content type='text'>
This change adds devm_hwrng_register and devm_hwrng_unregister which
use can simplify error unwinding and unbinding code paths in device
drivers.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: core - Use struct completion for cleanup_done</title>
<updated>2014-12-25T21:33:34Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2014-12-23T05:40:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=77584ee57434813b50fc85cde995a6271a5081b7'/>
<id>urn:sha1:77584ee57434813b50fc85cde995a6271a5081b7</id>
<content type='text'>
There is no point in doing a manual completion for cleanup_done
when struct completion fits in perfectly.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: fix unregister race.</title>
<updated>2014-12-22T12:02:40Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2014-12-08T08:50:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a027f30d72f2c4d27d6dd9bd053205d3102de7d1'/>
<id>urn:sha1:a027f30d72f2c4d27d6dd9bd053205d3102de7d1</id>
<content type='text'>
The previous patch added one potential problem: we can still be
reading from a hwrng when it's unregistered.  Add a wait for zero
in the hwrng_unregister path.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Amos Kong &lt;akong@redhat.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: use reference counts on each struct hwrng.</title>
<updated>2014-12-22T12:02:39Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2014-12-08T08:50:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3a2c0ba5ad00c018c0bef39a2224aca950aa33f2'/>
<id>urn:sha1:3a2c0ba5ad00c018c0bef39a2224aca950aa33f2</id>
<content type='text'>
current_rng holds one reference, and we bump it every time we want
to do a read from it.

This means we only hold the rng_mutex to grab or drop a reference,
so accessing /sys/devices/virtual/misc/hw_random/rng_current doesn't
block on read of /dev/hwrng.

Using a kref is overkill (we're always under the rng_mutex), but
a standard pattern.

This also solves the problem that the hwrng_fillfn thread was
accessing current_rng without a lock, which could change (eg. to NULL)
underneath it.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Amos Kong &lt;akong@redhat.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: add per-device entropy derating</title>
<updated>2014-07-15T08:49:40Z</updated>
<author>
<name>Torsten Duwe</name>
<email>duwe@lst.de</email>
</author>
<published>2014-06-15T03:48:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0f734e6e768b4b66737b3d3e13f1769a12ecff86'/>
<id>urn:sha1:0f734e6e768b4b66737b3d3e13f1769a12ecff86</id>
<content type='text'>
This patch introduces a derating factor to struct hwrng for
the random bits going into the kernel input pool, and a common
default derating for drivers which do not specify one.

Signed-off-by: Torsten Duwe &lt;duwe@suse.de&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Acked-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
</entry>
<entry>
<title>random: add_hwgenerator_randomness() for feeding entropy from devices</title>
<updated>2014-07-15T08:49:40Z</updated>
<author>
<name>Torsten Duwe</name>
<email>duwe@lst.de</email>
</author>
<published>2014-06-15T03:38:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c84dbf61a7b322188d2a7fddc0cc6317ac6713e2'/>
<id>urn:sha1:c84dbf61a7b322188d2a7fddc0cc6317ac6713e2</id>
<content type='text'>
This patch adds an interface to the random pool for feeding entropy
in-kernel.

Signed-off-by: Torsten Duwe &lt;duwe@suse.de&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Acked-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
</entry>
</feed>
