From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBZ9S-0001aj-9l for qemu-devel@nongnu.org; Fri, 01 Mar 2013 18:14:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UBZ9R-0005cQ-3N for qemu-devel@nongnu.org; Fri, 01 Mar 2013 18:14:06 -0500 Received: from mail-oa0-f49.google.com ([209.85.219.49]:64562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBZ9Q-0005cG-UY for qemu-devel@nongnu.org; Fri, 01 Mar 2013 18:14:05 -0500 Received: by mail-oa0-f49.google.com with SMTP id j6so6494559oag.8 for ; Fri, 01 Mar 2013 15:14:04 -0800 (PST) From: Anthony Liguori In-Reply-To: <513132DA.7030504@redhat.com> References: <512FF819.7050505@redhat.com> <87k3pqzy2y.fsf@codemonkey.ws> <513132DA.7030504@redhat.com> Date: Fri, 01 Mar 2013 17:14:01 -0600 Message-ID: <8738we4ssm.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] virtio-rng and fd passing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Krempa Cc: "qemu-devel@nongnu.org" , Stefan Berger Peter Krempa writes: > On 03/01/13 21:04, Anthony Liguori wrote: >> Eric Blake writes: >> >>> Stefan Berger and I discovered on IRC that virtio-rng is unable to >>> support fd passing. We attempted: >>> >>> qemu-system-x86_64 ... -add-fd set=4,fd=34,opaque=RDONLY:/dev/urandom >>> -object rng-random,id=rng0,filename=/dev/fdset/4 -device >>> virtio-rng-pci,rng=rng0,bus=pci.0,addr=0x6 >> >> Why are you using th rng-random backend instead of the rng-egd backend? > > There are two issues with using the egd backend for unprepared devices: > > 1) The backend spits out "\x20\x40" commands(egd blocking entropy > request for 0x40 bytes) so it really has to be used with some kind of > EGD server implementation otherwise it might feed your /dev/random with > predictable bytes if used directly. Yes. That's the point. > > 2) performance of the egd backend is terrible as I've reported here > https://bugzilla.redhat.com/show_bug.cgi?id=915381 (yes I'm aware that I > probably should have filed a upstream bug too, but I was hoping Amit > would do it in the process) > > On my machine I managed to do 0.2KiB/s with the egd backend both with > using constant data as a high performance source, but also with a true > random number generator (in the Raspberry pi SoC, sources 107KiB/s of > entropy). The rng-random backend performs a bit better averaging > 1.2MiB/s. That's a bug that I wasn't aware of until you wrote this. I'll look into it next week. Regards, Anthony Liguori > > Peter