Browse Source

Forbid `csrw vsstatus` from modifying the UXL field (#671)

Since this is not modifiable in the real sstatus, so it should not be
in the virtualized version either.
pull/674/head
Scott Johnson 5 years ago
committed by GitHub
parent
commit
6d5a351a98
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      riscv/processor.cc

1
riscv/processor.cc

@ -1189,6 +1189,7 @@ void processor_t::set_csr(int which, reg_t val)
((state.vsstatus & SSTATUS_XS) == SSTATUS_XS)) {
state.vsstatus |= (xlen == 64 ? SSTATUS64_SD : SSTATUS32_SD);
}
state.vsstatus = set_field(state.vsstatus, SSTATUS_UXL, xlen_to_uxl(max_xlen));
break;
}
case CSR_VSIE: {

Loading…
Cancel
Save