summaryrefslogtreecommitdiff
path: root/v
diff options
context:
space:
mode:
authorYunsup Lee <yunsup@cs.berkeley.edu>2015-03-16 02:09:10 -0700
committerYunsup Lee <yunsup@cs.berkeley.edu>2015-03-16 02:09:10 -0700
commitbe6511639c2d9291e9050682c4d7ce3e7042d061 (patch)
tree525ce2fef82e9a0c5bbdd52066e57f3cc4f843f9 /v
parent4ea6feac5fe663fe82de53632883ced6205f57f8 (diff)
downloadenv-be6511639c2d9291e9050682c4d7ce3e7042d061.zip
env-be6511639c2d9291e9050682c4d7ce3e7042d061.tar.gz
env-be6511639c2d9291e9050682c4d7ce3e7042d061.tar.bz2
clean up pt and vector environments
Diffstat (limited to 'v')
-rw-r--r--v/entry.S1
-rw-r--r--v/riscv_test.h6
-rw-r--r--v/vm.c4
3 files changed, 5 insertions, 6 deletions
diff --git a/v/entry.S b/v/entry.S
index 68c0f0a..c3c884d 100644
--- a/v/entry.S
+++ b/v/entry.S
@@ -145,7 +145,6 @@ trap_entry:
# disable saving vector state for now
addi t0,sp,SIZEOF_TRAPFRAME_T_SCALAR
- # rocket currently doesn't support vxcptsave/vxcptrestore natively
vgetcfg x4
STORE x4,0*REGBYTES(t0)
vgetvl x4
diff --git a/v/riscv_test.h b/v/riscv_test.h
index 30dd124..e076794 100644
--- a/v/riscv_test.h
+++ b/v/riscv_test.h
@@ -14,7 +14,7 @@
#undef RVTEST_RV64UV
#define RVTEST_RV64UV \
- RVTEST_RV64UF
+ RVTEST_RV64UF
#undef RVTEST_CODE_BEGIN
#define RVTEST_CODE_BEGIN \
@@ -60,8 +60,8 @@ userstart: \
#define vxcptkill() ({ \
asm volatile ("vxcptkill"); })
-#define vxcpthold() ({ \
- asm volatile ("vxcpthold"); })
+#define vxcpthold(addr) ({ \
+ asm volatile ("vxcpthold %0" : : "r"(addr)); })
#define venqcmd(bits, pf) ({ \
asm volatile ("venqcmd %0,%1" : : "r"(bits), "r"(pf)); })
diff --git a/v/vm.c b/v/vm.c
index a085577..7880b88 100644
--- a/v/vm.c
+++ b/v/vm.c
@@ -110,7 +110,7 @@ static void do_vxcptrestore(long* where)
vsetcfg(where[0]);
vsetvl(where[1]);
- vxcpthold();
+ vxcpthold(&where[2]);
int idx = 2;
long dword, cmd, pf;
@@ -216,7 +216,7 @@ void vm_boot(long test_addr, long seed)
l1pt[0] = (pte_t)l2pt | PTE_V | PTE_T;
l2pt[0] = (pte_t)l3pt | PTE_V | PTE_T;
write_csr(sptbr, l1pt);
- set_csr(mstatus, MSTATUS_IE1 | MSTATUS_FS /* | MSTATUS_XS */ | MSTATUS_MPRV);
+ set_csr(mstatus, MSTATUS_IE1 | MSTATUS_FS | MSTATUS_XS | MSTATUS_MPRV);
clear_csr(mstatus, MSTATUS_VM | MSTATUS_UA | MSTATUS_PRV1);
set_csr(mstatus, (long)VM_SV43 << __builtin_ctzl(MSTATUS_VM));
set_csr(mstatus, (long)UA_RV64 << __builtin_ctzl(MSTATUS_UA));