Received: from eggs.gnu.org ([2001:4830:134:3::10]:34339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbnQL-0003D7-Km for qemu-devel@nongnu.org; Tue, 15 Sep 2015 06:25:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbnQG-0008WI-0v for qemu-devel@nongnu.org; Tue, 15 Sep 2015 06:25:17 -0400 Date: Tue, 15 Sep 2015 15:54:57 +0530 From: Amit Shah Message-ID: <20150915102457.GB10281@grmbl.mre> References: <1441963021-31423-1-git-send-email-thuth@redhat.com> <20150914021506.GD2547@voom.fritz.box> <55F66A04.4010304@redhat.com> <20150915042606.GV2547@voom.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150915042606.GV2547@voom.fritz.box> Subject: Re: [Qemu-devel] [PATCH v3] ppc/spapr: Implement H_RANDOM hypercall in QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: Thomas Huth , agraf@suse.de, kvm-ppc@vger.kernel.org, qemu-devel@nongnu.org, michael@ellerman.id.au, qemu-ppc@nongnu.org, sam.bobroff@au1.ibm.com, gkurz@linux.vnet.ibm.com On (Tue) 15 Sep 2015 [14:26:06], David Gibson wrote: > On Mon, Sep 14, 2015 at 08:32:36AM +0200, Thomas Huth wrote: > > On 14/09/15 04:15, David Gibson wrote: > > > On Fri, Sep 11, 2015 at 11:17:01AM +0200, Thomas Huth wrote: > > >> The PAPR interface defines a hypercall to pass high-quality > > >> hardware generated random numbers to guests. Recent kernels can > > >> already provide this hypercall to the guest if the right hardware > > >> random number generator is available. But in case the user wants > > >> to use another source like EGD, or QEMU is running with an older > > >> kernel, we should also have this call in QEMU, so that guests that > > >> do not support virtio-rng yet can get good random numbers, too. > > >> > > >> This patch now adds a new pseude-device to QEMU that either > > >> directly provides this hypercall to the guest or is able to > > >> enable the in-kernel hypercall if available. The in-kernel > > >> hypercall can be enabled with the use-kvm property, e.g.: > > >> > > >> qemu-system-ppc64 -device spapr-rng,use-kvm=true > > >> > > >> For handling the hypercall in QEMU instead, a RngBackend is required > > >> since the hypercall should provide "good" random data instead of > > >> pseudo-random (like from a "simple" library function like rand() > > >> or g_random_int()). Since there are multiple RngBackends available, > > >> the user must select an appropriate backend via the "backend" > > >> property of the device, e.g.: > > >> > > >> qemu-system-ppc64 -object rng-random,filename=/dev/hwrng,id=rng0 \ > > >> -device spapr-rng,backend=rng0 ... (snip) > > > More importantly, this should probably be called "rng" not "backend" > > > to match virtio-rng. > > > > Since the device is already called "spapr-rng", i.e. has "rng" in its > > name, I'd rather like to keep this as "backend" to make it clear that > > you specify the backend this way. > > Hm, personally I'd weigh consistency with virtio-rng higher than the > slightly confusing name. Agreed. Amit