[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 04/10] target/riscv: Remove check on RVH for riscv_cpu_set_vir
From: |
Weiwei Li |
Subject: |
[PATCH v2 04/10] target/riscv: Remove check on RVH for riscv_cpu_set_virt_enabled |
Date: |
Mon, 27 Mar 2023 16:08:52 +0800 |
In current implementation, riscv_cpu_set_virt_enabled is only called when
RVH is enabled.
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
---
target/riscv/cpu_helper.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 62fd2c90f1..b286118a6b 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -563,12 +563,9 @@ bool riscv_cpu_virt_enabled(CPURISCVState *env)
return get_field(env->virt, VIRT_ONOFF);
}
+/* This function can only be called to set virt when RVH is enabled */
void riscv_cpu_set_virt_enabled(CPURISCVState *env, bool enable)
{
- if (!riscv_has_ext(env, RVH)) {
- return;
- }
-
/* Flush the TLB on all virt mode changes. */
if (get_field(env->virt, VIRT_ONOFF) != enable) {
tlb_flush(env_cpu(env));
--
2.25.1
- [PATCH v2 00/10] target/riscv: Simplification for RVH related check and code style fix, Weiwei Li, 2023/03/27
- [PATCH v2 02/10] target/riscv: Remove redundant check on RVH, Weiwei Li, 2023/03/27
- [PATCH v2 07/10] target/riscv: Remove redundant parentheses, Weiwei Li, 2023/03/27
- [PATCH v2 01/10] target/riscv: Remove redundant call to riscv_cpu_virt_enabled, Weiwei Li, 2023/03/27
- [PATCH v2 03/10] target/riscv: Remove check on RVH for riscv_cpu_virt_enabled, Weiwei Li, 2023/03/27
- [PATCH v2 10/10] target/riscv: Fix lines with over 80 characters, Weiwei Li, 2023/03/27
- [PATCH v2 05/10] target/riscv: Convert env->virt to a bool env->virt_enabled, Weiwei Li, 2023/03/27
- [PATCH v2 04/10] target/riscv: Remove check on RVH for riscv_cpu_set_virt_enabled,
Weiwei Li <=
- [PATCH v2 06/10] target/riscv: Remove riscv_cpu_virt_enabled(), Weiwei Li, 2023/03/27
- [PATCH v2 08/10] target/riscv: Fix format for indentation, Weiwei Li, 2023/03/27
- [PATCH v2 09/10] target/riscv: Fix format for comments, Weiwei Li, 2023/03/27