target/riscv: Smepmp: Return error when access permission not allowed in PMP
authorHimanshu Chauhan <hchauhan@ventanamicro.com>
Mon, 5 Jun 2023 16:45:48 +0000 (22:15 +0530)
committerAlistair Francis <alistair.francis@wdc.com>
Tue, 13 Jun 2023 07:45:30 +0000 (17:45 +1000)
commita574b27af4fe340684ca9f20560a1b01905e4364
tree9c1053cadf1deb1faa99991dafd05ceed32d7d82
parent949b6bcb27295eb04350afac32a45b698fc50104
target/riscv: Smepmp: Return error when access permission not allowed in PMP

On an address match, skip checking for default permissions and return error
based on access defined in PMP configuration.

v3 Changes:
o Removed explicit return of boolean value from comparision
  of priv/allowed_priv

v2 Changes:
o Removed goto to return in place when address matches
o Call pmp_hart_has_privs_default at the end of the loop

Fixes: 90b1fafce06 ("target/riscv: Smepmp: Skip applying default rules when address matches")
Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Message-Id: <20230605164548.715336-1-hchauhan@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/pmp.c