From 093ce837e1facb4168fbe24974ee92220cdd1907 Mon Sep 17 00:00:00 2001 From: Weiwei Li Date: Wed, 17 May 2023 17:15:10 +0800 Subject: target/riscv: Make the short cut really work in pmp_hart_has_privs Return the result directly for short cut, since We needn't do the following check on the PMP entries if there is no PMP rules. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Alistair Francis Message-Id: <20230517091519.34439-4-liweiwei@iscas.ac.cn> Signed-off-by: Alistair Francis --- target/riscv/pmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index 2bc9243..3c90562 100644 --- a/target/riscv/pmp.c +++ b/target/riscv/pmp.c @@ -316,6 +316,7 @@ int pmp_hart_has_privs(CPURISCVState *env, target_ulong addr, allowed_privs, mode)) { ret = MAX_RISCV_PMPS; } + return ret; } if (size == 0) { -- cgit v1.1