summaryrefslogtreecommitdiff
path: root/v
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2016-08-26 20:25:54 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2016-08-26 20:25:54 -0700
commitce70afbf50a203be04bc326326cfa75831fe7f5d (patch)
tree08481998f5370875b2d99f4dda4f94cc1a05ec99 /v
parent1386acb05aa78f54635d7074e2cb552278602dfd (diff)
downloadenv-ce70afbf50a203be04bc326326cfa75831fe7f5d.zip
env-ce70afbf50a203be04bc326326cfa75831fe7f5d.tar.gz
env-ce70afbf50a203be04bc326326cfa75831fe7f5d.tar.bz2
Disable interrupts during VM tests
The code doesn't support interrupts, and it was relying on the reset value of the mie register (which is undefined) to disable them.
Diffstat (limited to 'v')
-rw-r--r--v/vm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/v/vm.c b/v/vm.c
index 7659cee..2530785 100644
--- a/v/vm.c
+++ b/v/vm.c
@@ -217,10 +217,11 @@ void vm_boot(uintptr_t test_addr)
(1 << CAUSE_FAULT_FETCH) |
(1 << CAUSE_FAULT_LOAD) |
(1 << CAUSE_FAULT_STORE));
- // on ERET, user mode w/interrupts on; FPU on; accelerator on; VM on
+ // on ERET, user mode; FPU on; accelerator on; VM on
int vm_choice = sizeof(long) == 8 ? VM_SV39 : VM_SV32;
- write_csr(mstatus, MSTATUS_UIE | MSTATUS_FS | MSTATUS_XS |
+ write_csr(mstatus, MSTATUS_FS | MSTATUS_XS |
(vm_choice * (MSTATUS_VM & ~(MSTATUS_VM<<1))));
+ write_csr(mie, 0);
random = 1 + (random % MAX_TEST_PAGES);
freelist_head = pa2kva((void*)&freelist_nodes[0]);