Browse Source

Fix RV32 hgatp write mask computation (#1014)

clang with `-Wall` happened to catch this.
pull/1018/head
Andrew Waterman 4 years ago
committed by GitHub
parent
commit
68b3eb9bf1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      riscv/csrs.cc

2
riscv/csrs.cc

@ -1075,7 +1075,7 @@ bool hgatp_csr_t::unlogged_write(const reg_t val) noexcept {
if (proc->get_const_xlen() == 32) { if (proc->get_const_xlen() == 32) {
mask = HGATP32_PPN | mask = HGATP32_PPN |
HGATP32_MODE | HGATP32_MODE |
proc->supports_impl(IMPL_MMU_VMID) ? HGATP32_VMID : 0; (proc->supports_impl(IMPL_MMU_VMID) ? HGATP32_VMID : 0);
} else { } else {
mask = (HGATP64_PPN & ((reg_t(1) << (MAX_PADDR_BITS - PGSHIFT)) - 1)) | mask = (HGATP64_PPN & ((reg_t(1) << (MAX_PADDR_BITS - PGSHIFT)) - 1)) |
(proc->supports_impl(IMPL_MMU_VMID) ? HGATP64_VMID : 0); (proc->supports_impl(IMPL_MMU_VMID) ? HGATP64_VMID : 0);

Loading…
Cancel
Save