[PATCH] target/loongarch: Clean up tlb when cpu reset

Song Gao posted 1 patch 1 year, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220705070950.2364243-1-gaosong@loongson.cn
Maintainers: Song Gao <gaosong@loongson.cn>, Xiaojuan Yang <yangxiaojuan@loongson.cn>
target/loongarch/cpu.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] target/loongarch: Clean up tlb when cpu reset
Posted by Song Gao 1 year, 10 months ago
We should make sure that tlb is clean when cpu reset.

Signed-off-by: Song Gao <gaosong@loongson.cn>
---
 target/loongarch/cpu.c | 1 +
 1 file changed, 1 insertion(+)

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);
-- 
2.31.1
Re: [PATCH] target/loongarch: Clean up tlb when cpu reset
Posted by Richard Henderson 1 year, 10 months ago
On 7/5/22 12:39, Song Gao wrote:
> We should make sure that tlb is clean when cpu reset.
> 
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---
>   target/loongarch/cpu.c | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Applied.


r~