Re: [PATCH] target/riscv: Fix priority of csr related check in riscv_csrrw_check

2022-08-04 Thread Alistair Francis
On Wed, Aug 3, 2022 at 10:56 PM Weiwei Li wrote: > > 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 supp

Re: [PATCH] target/riscv: Fix priority of csr related check in riscv_csrrw_check

2022-08-04 Thread Alistair Francis
On Wed, Aug 3, 2022 at 10:56 PM Weiwei Li wrote: > > 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 supp

Re: [PATCH] target/riscv: Fix priority of csr related check in riscv_csrrw_check

2022-08-04 Thread Anup Patel
On Thu, Aug 4, 2022 at 5:59 PM Weiwei Li wrote: > > > 在 2022/8/4 上午11:38, Anup Patel 写道: > > On Wed, Aug 3, 2022 at 6:16 PM Weiwei Li wrote: > >> Normally, riscv_csrrw_check is called when executing Zicsr instructions. > >> And we can only do access control for existed CSRs. So the priority of >

Re: [PATCH] target/riscv: Fix priority of csr related check in riscv_csrrw_check

2022-08-04 Thread Weiwei Li
在 2022/8/4 上午11:38, Anup Patel 写道: On Wed, Aug 3, 2022 at 6:16 PM Weiwei Li wrote: 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

Re: [PATCH] target/riscv: Fix priority of csr related check in riscv_csrrw_check

2022-08-03 Thread Anup Patel
On Wed, Aug 3, 2022 at 6:16 PM Weiwei Li wrote: > > 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 suppo

[PATCH] target/riscv: Fix priority of csr related check in riscv_csrrw_check

2022-08-03 Thread Weiwei Li
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