From 68b3eb9bf1c04c19a66631f717163dd9ba2c923c Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Thu, 26 May 2022 14:21:07 -0700 Subject: [PATCH] Fix RV32 hgatp write mask computation (#1014) clang with `-Wall` happened to catch this. --- riscv/csrs.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv/csrs.cc b/riscv/csrs.cc index 3d6cf911..6bca99c9 100644 --- a/riscv/csrs.cc +++ b/riscv/csrs.cc @@ -1075,7 +1075,7 @@ bool hgatp_csr_t::unlogged_write(const reg_t val) noexcept { if (proc->get_const_xlen() == 32) { mask = HGATP32_PPN | HGATP32_MODE | - proc->supports_impl(IMPL_MMU_VMID) ? HGATP32_VMID : 0; + (proc->supports_impl(IMPL_MMU_VMID) ? HGATP32_VMID : 0); } else { mask = (HGATP64_PPN & ((reg_t(1) << (MAX_PADDR_BITS - PGSHIFT)) - 1)) | (proc->supports_impl(IMPL_MMU_VMID) ? HGATP64_VMID : 0);