From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBYuq-0005nz-H2 for qemu-devel@nongnu.org; Fri, 01 Mar 2013 17:59:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UBYun-0000qJ-Gd for qemu-devel@nongnu.org; Fri, 01 Mar 2013 17:59:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBYun-0000q9-9B for qemu-devel@nongnu.org; Fri, 01 Mar 2013 17:58:57 -0500 Message-ID: <513132DA.7030504@redhat.com> Date: Fri, 01 Mar 2013 23:59:38 +0100 From: Peter Krempa MIME-Version: 1.0 References: <512FF819.7050505@redhat.com> <87k3pqzy2y.fsf@codemonkey.ws> In-Reply-To: <87k3pqzy2y.fsf@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] virtio-rng and fd passing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: "qemu-devel@nongnu.org" , Stefan Berger 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. 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. Peter