From mboxrd@z Thu Jan 1 00:00:00 1970 From: Herbert Xu Subject: Re: virtio-rng only returns zeros with CONFIG_HW_RANDOM=m Date: Sun, 10 Mar 2013 16:26:43 +0800 Message-ID: <20130310082643.GA10448@gondor.apana.org.au> References: <20130224231154.GA30477@hall.aurel32.net> <87sj4ieecg.fsf@rustcorp.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Aurelien Jarno , kvm@vger.kernel.org, Ian Molton , Matt Mackall To: Rusty Russell Return-path: Received: from sting.hengli.com.au ([178.18.18.71]:44707 "EHLO fornost.hengli.com.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752114Ab3CJI0y (ORCPT ); Sun, 10 Mar 2013 04:26:54 -0400 Content-Disposition: inline In-Reply-To: <87sj4ieecg.fsf@rustcorp.com.au> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Feb 27, 2013 at 11:56:55AM +1030, Rusty Russell wrote: > > OK, I looked at doing a kmalloc and copy in virtio_rng, but it's very > inelegant (we don't know what size of buffer to allocate). As the hwrng API allows you to return any number of bytes, you can just go back to the old virtio-rng code that did the 64-byte buffer and return a maximum of 64 bytes each time. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt