[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH pic32 v2 2/5] Fixed random index generation for
From: |
Maciej W. Rozycki |
Subject: |
Re: [Qemu-devel] [PATCH pic32 v2 2/5] Fixed random index generation for TLBWR instruction. It was not quite random and did not skip Wired entries. |
Date: |
Fri, 3 Jul 2015 22:39:54 +0100 (BST) |
User-agent: |
Alpine 2.11 (LFD 23 2013-08-11) |
On Wed, 1 Jul 2015, Aurelien Jarno wrote:
> Secondly, I don't think calling random() is the correct thing to do.
> It's an expensive function that is not thread safe. Quoting the
> specification:
>
> "Within the required constraints of the upper and lower bounds, the
> manner in which the processor selects values for the Random register
> is implementation-dependent."
>
> So it's fine if we use a PRNG like the current code, but I agree we
> might want to improve it if it has some issues. We want to keep its
> value reproducible though so that the icount mode works as expected.
Implementations often implement CP0.Random as a free-running counter that
decrements between the bounds set as each instruction executes.
Maciej
Message not available
Message not available