WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] generate random numbers

To: "michele.paolino" <michele.paolino@xxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] generate random numbers
From: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Date: Fri, 12 Feb 2010 12:15:41 +0000
Cc: Xen-devel@xxxxxxxxxxxxxxxxxxx, James Harper <james.harper@xxxxxxxxxxxxxxxx>
Delivery-date: Fri, 12 Feb 2010 04:16:04 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=MaVsEipCNyrm+jfDET83k9P/ng1+Cl74jrR3IhmYJlc=; b=nXpcfOVz4PHBaGXe0cp7KFuKNTdB3jmiccnWIAfdorILDHdUF3LtQOxHv4LIIHh9NS 4BSO8+Kr1F2aV6AGnCZponxch4R47Zitg09a3FS9agcLOmtHC5ME9b9fhuqlzQ0DQ3dn IgVOG5jHITicyWjYxQ36DWB4XJIv8e1HDM2kI=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=An+3URdfy5PIvuLikH6o24IbWkneEPV9mB6ntZ38RbdkZNa7sGcOx+IU5jkwOdIWIm 44IqZLy5giUfFNkVK1cR3W/cWYUAEcq93/WNSlr62R5dQkhOA6mOYiaO+pjSs6Jv0Zt2 SLKVG1pGMtwE/oOl/1yb5ywK1ChKrtMLb5rjE=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <14f366f91002120032uc08b7d6sb2283e10c9444bbf@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <14f366f91002111231reae2e41vc8f823b38e16a76b@xxxxxxxxxxxxxx> <AEC6C66638C05B468B556EA548C1A77D01899202@trantor> <14f366f91002120032uc08b7d6sb2283e10c9444bbf@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
I think the short answer is, Xen does not have a mechanism to collect
true randomness at the moment.  I'm not an expert in random numbers,
so the bitrate doesn't mean anything to me.  A couple of possible
solutions come to mind:
* Use pseudo-random numbers to start out with and test your theories,
while working on getting truly random numbers in.
* Punt the problem to dom0: Have a daemon in dom0 to read /dev/urandom
and "upload" values into a ring read by Xen.  If the ring is empty,
use pseudo-random numbers seeded by old values in the ring (?).
* Add entropy-collection to Xen.
* If interrupted by a timer that's longer than 1ms, just take a TSC
and lop off the lower 10 bits.  If you haven't been interrupted by a
timer, use pseudorandom numbers seeded by the lower 10 bits of the
last TSC.

As I said, I'm not an expert in collecting entropy, so some of these
may be obviously brain-dead ideas.  But it might give you enough to
get started.

 -George

On Fri, Feb 12, 2010 at 8:32 AM, michele.paolino
<michele.paolino@xxxxxxxxxxxxxxx> wrote:
> I need less than 10 bits at rate of 10 milliseconds. With a random number I
> will select the next VCPU to schedule.
>
> Michele
>
> On Fri, Feb 12, 2010 at 2:51 AM, James Harper
> <james.harper@xxxxxxxxxxxxxxxx> wrote:
>>
>> >
>> > Hi!
>> > I am interested in writing a scheduler for Xen for academic purposes.
>> I need
>> > to generate random numbers.
>> > Is it possible to generate random numbers in xen hypervisor
>> developement?If
>> > this is possible, how can I do it?
>> >
>>
>> How many bits do you random numbers need to be?
>>
>> At what rate do you need them? (10/second?, 1000000/second?)
>>
>> Would pseudo-random numbers do? If so, what repeat interval is
>> sufficient?
>>
>> James
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel