All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Amit Shah <amit.shah@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, Andreas Faerber <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH 0/8] add paravirtualization hwrng support (v2)
Date: Wed, 31 Oct 2012 08:12:39 +0100	[thread overview]
Message-ID: <20121031071239.GA3855@ohm.aurel32.net> (raw)
In-Reply-To: <50907DCB.50501@zytor.com>

On Tue, Oct 30, 2012 at 06:24:27PM -0700, H. Peter Anvin wrote:
> On 10/30/2012 04:02 PM, Anthony Liguori wrote:
> >
> >My take away from all of the various discussions on what the Right Way to
> >use virtio-rng is:
> >
> >  1) /dev/random should always be used as the entropy source (I've left it
> >     configurable though)
> >
> >  2) I think the Right Way to configure virtio-rng is to figure out what the
> >     available entropy is on the host, and then decide how to allocate that
> >     to each guest.  As such, I've implemented rate limiting.
> >
> >     I think QEMU is the right place to do this because this is a property of
> >     specific virtual machines.  I can imagine a cloud provider wanting to
> >     guarantee a certain level of entropy for different classes of VMs.  Even
> >     if rngd could be used to do this, configuring it differently for different
> >     guests would be cumbersome.
> >
> 
> rngd is not where this should happen, it should be in the
> /dev/random implementation in the (host) kernel.  That way it is
> applicable to all types of clients, not just Qemu.
> 
> >  3) `qemu -device virtio-rng-pci` will Just Work but risks exhausting host
> >     entropy.  This means we can't make it the default for machines.  But for
> >     most command line users, I think this is the behavior they want.
> 
> It's a bit unfortunate, but I'm not going to push on that point.
> 
> Given the migration issue I'll write up an implementation of a DRNG
> (RDRAND/RDSEED) backend once this is upstream.  If RDRAND is
> disabled in the guest, but available in the host, this would be the
> one to use.  If RDRAND is available in the guest it should be used
> directly if rngd is new enough, but since virtio-rng has been in the
> kernel since 2008 there still might be some guests which could use
> such an implementation without having been RDRAND-enabled.
> 

That is also a good idea for emulation, and especially to provide
non-x86 guests with entropy.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

      parent reply	other threads:[~2012-10-31  7:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30 23:02 [Qemu-devel] [PATCH 0/8] add paravirtualization hwrng support (v2) Anthony Liguori
2012-10-30 23:02 ` [Qemu-devel] [PATCH 1/8] vl: add -object option to create QOM objects from the command line Anthony Liguori
2012-10-30 23:02 ` [Qemu-devel] [PATCH 2/8] object: add object_property_add_bool (v2) Anthony Liguori
2012-10-30 23:02 ` [Qemu-devel] [PATCH 3/8] rng: add RndBackend abstract object class Anthony Liguori
2012-10-30 23:02 ` [Qemu-devel] [PATCH 4/8] rng-random: add an RNG backend that uses /dev/random (v2) Anthony Liguori
2012-10-31  7:36   ` Paolo Bonzini
2012-10-30 23:02 ` [Qemu-devel] [PATCH 5/8] rng-egd: introduce EGD compliant RNG backend Anthony Liguori
2012-10-30 23:02 ` [Qemu-devel] [PATCH 6/8] virtio-rng: hardware random number generator device Anthony Liguori
2012-10-30 23:02 ` [Qemu-devel] [PATCH 7/8] virtio-rng: add rate limiting support Anthony Liguori
2012-10-30 23:02 ` [Qemu-devel] [PATCH 8/8] virtio-rng-pci: create a default backend if none exists Anthony Liguori
2012-10-31  1:24 ` [Qemu-devel] [PATCH 0/8] add paravirtualization hwrng support (v2) H. Peter Anvin
2012-10-31  2:12   ` Anthony Liguori
2012-10-31  7:12   ` Aurelien Jarno [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=20121031071239.GA3855@ohm.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=amit.shah@redhat.com \
    --cc=hpa@zytor.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.