summary refs log tree commit diff stats
path: root/target/loongarch/cpu.c
diff options
context:
space:
mode:
authorTianrui Zhao <zhaotianrui@loongson.cn>2024-01-05 15:57:59 +0800
committerSong Gao <gaosong@loongson.cn>2024-01-11 19:14:00 +0800
commitf8447436d3b583365113997f1dee35f92a21abbd (patch)
tree3f909b8a6b56503a5aff15beec6295c2f5850938 /target/loongarch/cpu.c
parent627846569697d412a16be318091f1dc81e6954c0 (diff)
downloadfocaccia-qemu-f8447436d3b583365113997f1dee35f92a21abbd.tar.gz
focaccia-qemu-f8447436d3b583365113997f1dee35f92a21abbd.zip
target/loongarch: Implement kvm get/set registers
Implement kvm_arch_get/set_registers interfaces, many regs
can be get/set in the function, such as core regs, csr regs,
fpu regs, mp state, etc.

Signed-off-by: Tianrui Zhao <zhaotianrui@loongson.cn>
Signed-off-by: xianglai li <lixianglai@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Change-Id: Ia8fc48fe08b1768853f7729e77d37cdf270031e4
Message-Id: <20240105075804.1228596-5-zhaotianrui@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Diffstat (limited to 'target/loongarch/cpu.c')
-rw-r--r--target/loongarch/cpu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index 9b768c9431..0c157bbd51 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -540,6 +540,9 @@ static void loongarch_cpu_reset_hold(Object *obj)
 #ifndef CONFIG_USER_ONLY
     env->pc = 0x1c000000;
     memset(env->tlb, 0, sizeof(env->tlb));
+    if (kvm_enabled()) {
+        kvm_arch_reset_vcpu(env);
+    }
 #endif
 
     restore_fp_status(env);