[PATCH v3 1/2] target/riscv: Remove redundant check in pmp_is_locked

2023-07-08 Thread Ruibo Lu
the check of top PMP is redundant and will not influence the return value, so consider remove it Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1733 Reviewed-by: Weiwei Li Reviewed-by: Alistair Francis Signed-off-by: Ruibo Lu --- target/riscv/pmp.c | 5 - 1 file changed, 5

[PATCH v3 0/2] target/riscv: improve code accuracy and

2023-07-08 Thread Ruibo Lu
change the initial values of sa_in and ea_in to false * change the condition expression when address area fully in range Ruibo Lu (2): target/riscv: Remove redundant check in pmp_is_locked target/riscv: Optimize ambiguous local variable in pmp_hart_has_privs target/riscv/pmp.c | 27 ++

[PATCH v3 2/2] target/riscv: Optimize ambiguous local variable in pmp_hart_has_privs

2023-07-08 Thread Ruibo Lu
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ruibo Lu --- target/riscv/pmp.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index 1a9279ba88..ea3d29217a 100644 --- a/target/riscv/pmp.c +++ b/target/riscv/pmp.c

[PATCH v3 2/2] target/riscv: Optimize ambiguous local variable in pmp_hart_has_privs

2023-07-07 Thread Ruibo Lu
-Daudé Reviewed-by: Weiwei Li Reviewed-by: Alistair Francis Signed-off-by: Ruibo Lu --- target/riscv/pmp.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index 1a9279ba88..ea3d29217a 100644 --- a/target/riscv

[PATCH v3 1/2] target/riscv: Remove redundant check in pmp_is_locked

2023-07-07 Thread Ruibo Lu
the check of top PMP is redundant and will not influence the return value, so consider remove it Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1733 Reviewed-by: Weiwei Li Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ruibo Lu --- target/riscv

[PATCH v2 1/2] target/riscv: Remove redundant check in pmp_is_locked

2023-07-03 Thread Ruibo Lu
the check of top PMP is redundant and will not influence the return value, so consider remove it Reviewed-by: Weiwei Li Reviewed-by: Alistair Francis Signed-off-by: Ruibo Lu --- target/riscv/pmp.c | 5 - 1 file changed, 5 deletions(-) diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c

[PATCH v2 2/2] target/riscv: Optimize ambiguous local variable in pmp_hart_has_privs

2023-07-03 Thread Ruibo Lu
These two values represents whether start/end address is in pmp_range. However, the type and name of them is ambiguous. This commit change the name and type of them to improve code readability and accuracy. Reviewed-by: Weiwei Li Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ruibo Lu

[PATCH v2] target/riscv: Optimize ambiguous local variable in pmp_hart_has_privs

2023-07-03 Thread Ruibo Lu
These two values represents whether start/end address is in pmp_range. However, the type and name of them is ambiguous. This commit change the name and type of them to improve code readability and accuracy. Signed-off-by: Ruibo Lu --- target/riscv/pmp.c | 20 ++-- 1 file changed

[PATCH 0/2] improve accuracy in riscv-pmp

2023-06-28 Thread Ruibo Lu
Based-on: 4329d049d5b8d4af71c6b399d64a6d1b98856318 Ruibo Lu (2): target/riscv: Remove redundant check in pmp_is_locked target/riscv: Optimize ambiguous local variable in pmp_hart_has_privs target/riscv/pmp.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions

[PATCH 1/2] target/riscv: Remove redundant check in pmp_is_locked

2023-06-28 Thread Ruibo Lu
the check of top PMP is redundant and will not influence the return value, so consider remove it Signed-off-by: Ruibo Lu --- target/riscv/pmp.c | 5 - 1 file changed, 5 deletions(-) diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index 9d8db493e6..1a9279ba88 100644 --- a/target/riscv

[PATCH 2/2] target/riscv: Optimize ambiguous local variable in pmp_hart_has_privs

2023-06-28 Thread Ruibo Lu
These two values represents whether start/end address is in pmp_range. However, the type and name of them is ambiguous. This commit change the name and type of them to improve code readability and accuracy. Signed-off-by: Ruibo Lu --- target/riscv/pmp.c | 20 ++-- 1 file changed