aboutsummaryrefslogtreecommitdiff
path: root/hw/intc
diff options
context:
space:
mode:
authorWeiwei Li <liweiwei@iscas.ac.cn>2022-08-03 20:36:52 +0800
committerAlistair Francis <alistair.francis@wdc.com>2022-09-07 09:18:33 +0200
commiteacaf440195675bc528f4aac394da7a74a9d95eb (patch)
tree7e40a4e38df77b0be4b9c75fe15348dd421091de /hw/intc
parent6934f15b225c9324eafa064d3520a698ed09f9df (diff)
downloadqemu-eacaf440195675bc528f4aac394da7a74a9d95eb.zip
qemu-eacaf440195675bc528f4aac394da7a74a9d95eb.tar.gz
qemu-eacaf440195675bc528f4aac394da7a74a9d95eb.tar.bz2
target/riscv: Fix priority of csr related check in riscv_csrrw_check
Normally, riscv_csrrw_check is called when executing Zicsr instructions. And we can only do access control for existed CSRs. So the priority of CSR related check, from highest to lowest, should be as follows: 1) check whether Zicsr is supported: raise RISCV_EXCP_ILLEGAL_INST if not 2) check whether csr is existed: raise RISCV_EXCP_ILLEGAL_INST if not 3) do access control: raise RISCV_EXCP_ILLEGAL_INST or RISCV_EXCP_VIRT_ INSTRUCTION_FAULT if not allowed The predicates contain parts of function of both 2) and 3), So they need to be placed in the middle of riscv_csrrw_check Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn> Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20220803123652.3700-1-liweiwei@iscas.ac.cn> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'hw/intc')
0 files changed, 0 insertions, 0 deletions