From mboxrd@z Thu Jan 1 00:00:00 1970 From: "michele.paolino" Subject: Re: generate random numbers Date: Fri, 12 Feb 2010 23:42:33 +0100 Message-ID: <14f366f91002121442h536a2d03if7d9bdee416a4a23@mail.gmail.com> References: <14f366f91002111231reae2e41vc8f823b38e16a76b@mail.gmail.com> <14f366f91002120032uc08b7d6sb2283e10c9444bbf@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1915967223==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: George Dunlap Cc: Xen-devel@lists.xensource.com, James Harper List-Id: xen-devel@lists.xenproject.org --===============1915967223== Content-Type: multipart/alternative; boundary=0003255558d2ec9792047f6efcc3 --0003255558d2ec9792047f6efcc3 Content-Type: text/plain; charset=ISO-8859-1 Ok, thanks! this is enought to get started. but how can I read a random number from /dev/urandom? is Xend the deamon that you talk me about? Thanks Michele On Fri, Feb 12, 2010 at 1:15 PM, George Dunlap wrote: > 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 > 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 > > 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 > > > > > --0003255558d2ec9792047f6efcc3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ok, thanks! this is enought to get started.
but how can I read a random= number from /dev/urandom? is Xend the deamon that you talk me about?
Thanks
Michele


On Fri, Feb 12, 2= 010 at 1:15 PM, George Dunlap <George.Dunlap@eu.citrix.com&g= t; wrote:
I think the short= answer is, Xen does not have a mechanism to collect
true randomness at the moment. =A0I'm not an expert in random numbers,<= br> so the bitrate doesn't mean anything to me. =A0A 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. =A0If the ring is em= pty,
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. =A0If you haven't been interrupted by a<= br> 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. =A0But it might give you enough to
get started.

=A0-George

On Fri, Feb 12, 2010 at 8:32 AM, michele.paolino
<mi= chele.paolino@studio.unibo.it> wrote:
> I need less than 10 bits at rate of 10 milliseconds. With a random num= ber 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 p= urposes.
>> 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
> htt= p://lists.xensource.com/xen-devel
>
>

--0003255558d2ec9792047f6efcc3-- --===============1915967223== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1915967223==--