target/riscv: Deny access if access is partially inside the PMP entry
Access will fail if access is partially inside the PMP entry. However,only setting ret = false doesn't really mean pmp violation since pmp_hart_has_privs_default() may return true at the end of pmp_hart_has_privs(). 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: <20230517091519.34439-13-liweiwei@iscas.ac.cn> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
1b63f2fee6
commit
89fbbaddfb
@ -327,8 +327,8 @@ bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
|
||||
if ((s + e) == 1) {
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"pmp violation - access is partially inside\n");
|
||||
ret = false;
|
||||
break;
|
||||
*allowed_privs = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* fully inside */
|
||||
|
Loading…
Reference in New Issue
Block a user