summaryrefslogtreecommitdiff
path: root/v
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2019-08-15 14:48:00 -0700
committerAndrew Waterman <andrew@sifive.com>2019-08-15 14:48:00 -0700
commit6d33722fe1c2f07c2c43feef04c17ad856d9b277 (patch)
tree97ff0769c86a0a6476cc16b355ccb7f674d9b33f /v
parentd3e85ae435d1cdb782155530e9de83d6f14b6ae0 (diff)
downloadenv-6d33722fe1c2f07c2c43feef04c17ad856d9b277.zip
env-6d33722fe1c2f07c2c43feef04c17ad856d9b277.tar.gz
env-6d33722fe1c2f07c2c43feef04c17ad856d9b277.tar.bz2
Don't truncate the LFSR to 32 bits
This caused it to collapse to 0, preventing coherence_torture from doing anything interesting at all...
Diffstat (limited to 'v')
-rw-r--r--v/vm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/v/vm.c b/v/vm.c
index 8fd9811..df302b4 100644
--- a/v/vm.c
+++ b/v/vm.c
@@ -210,7 +210,7 @@ void handle_trap(trapframe_t* tf)
static void coherence_torture()
{
// cause coherence misses without affecting program semantics
- unsigned int random = ENTROPY;
+ uint64_t random = ENTROPY;
while (1) {
uintptr_t paddr = DRAM_BASE + ((random % (2 * (MAX_TEST_PAGES + 1) * PGSIZE)) & -4);
#ifdef __riscv_atomic
@@ -225,7 +225,7 @@ static void coherence_torture()
void vm_boot(uintptr_t test_addr)
{
- unsigned int random = ENTROPY;
+ uint64_t random = ENTROPY;
if (read_csr(mhartid) > 0)
coherence_torture();