diff mbox series

[PULL,2/6] target/loongarch: Clean up tlb when cpu reset

Message ID 20220705105957.1144514-4-richard.henderson@linaro.org
State New
Headers show
Series [PULL,1/6] hw/rtc/ls7a_rtc: Drop unused inline functions | expand

Commit Message

Richard Henderson July 5, 2022, 10:59 a.m. UTC
From: Song Gao <gaosong@loongson.cn>

We should make sure that tlb is clean when cpu reset.

Signed-off-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/loongarch/cpu.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index d2d4667a34..e21715592a 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -479,6 +479,7 @@  static void loongarch_cpu_reset(DeviceState *dev)
 
 #ifndef CONFIG_USER_ONLY
     env->pc = 0x1c000000;
+    memset(env->tlb, 0, sizeof(env->tlb));
 #endif
 
     restore_fp_status(env);