xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: "michele.paolino" <michele.paolino@studio.unibo.it>
Cc: Xen-devel@lists.xensource.com,
	James Harper <james.harper@bendigoit.com.au>
Subject: Re: generate random numbers
Date: Fri, 12 Feb 2010 12:15:41 +0000	[thread overview]
Message-ID: <de76405a1002120415l717292e6g484a342337ac414b@mail.gmail.com> (raw)
In-Reply-To: <14f366f91002120032uc08b7d6sb2283e10c9444bbf@mail.gmail.com>

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@studio.unibo.it> 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@bendigoit.com.au> 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@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
>

  reply	other threads:[~2010-02-12 12:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-11 20:31 generate random numbers michele.paolino
2010-02-12  1:51 ` James Harper
2010-02-12  8:32   ` michele.paolino
2010-02-12 12:15     ` George Dunlap [this message]
2010-02-12 22:42       ` michele.paolino
2010-02-12 23:12         ` Daniel Stodden
2010-02-25 18:31           ` michele.paolino
2010-02-25 21:25             ` George Dunlap
2010-02-26 17:43               ` michele.paolino
2010-02-26 17:44                 ` George Dunlap
2010-02-26 18:54                   ` michele.paolino
2010-03-01 11:41                     ` George Dunlap
2010-03-01 16:56                       ` michele.paolino
2010-03-02 12:58                         ` George Dunlap
2010-03-03  7:52                           ` michele.paolino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=de76405a1002120415l717292e6g484a342337ac414b@mail.gmail.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=james.harper@bendigoit.com.au \
    --cc=michele.paolino@studio.unibo.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).