[PATCH 3/3] target/loongarch: Remove LoongArch TLB migration support in TCG mode

Bibo Mao posted 3 patches 3 weeks, 1 day ago
Maintainers: Song Gao <gaosong@loongson.cn>
There is a newer version of this series
[PATCH 3/3] target/loongarch: Remove LoongArch TLB migration support in TCG mode
Posted by Bibo Mao 3 weeks, 1 day ago
With empty TLB table, system works well still after migration. TLB
migration is used in TCG mode and not necessary in KVM mode. And this
piece of code increases maintainance difficulty and not necessary,
here remove TLB migration support.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 target/loongarch/machine.c | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/target/loongarch/machine.c b/target/loongarch/machine.c
index 0a3febf36d..e0c2da43bf 100644
--- a/target/loongarch/machine.c
+++ b/target/loongarch/machine.c
@@ -178,38 +178,6 @@ static const VMStateDescription vmstate_pmu = {
     },
 };
 
-#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
-static bool tlb_needed(void *opaque)
-{
-    return tcg_enabled();
-}
-
-/* TLB state */
-static const VMStateDescription vmstate_tlb_entry = {
-    .name = "cpu/tlb_entry",
-    .version_id = 0,
-    .minimum_version_id = 0,
-    .fields = (const VMStateField[]) {
-        VMSTATE_UINT64(tlb_misc, LoongArchTLB),
-        VMSTATE_UINT64(tlb_entry0, LoongArchTLB),
-        VMSTATE_UINT64(tlb_entry1, LoongArchTLB),
-        VMSTATE_END_OF_LIST()
-    }
-};
-
-static const VMStateDescription vmstate_tlb = {
-    .name = "cpu/tlb",
-    .version_id = 0,
-    .minimum_version_id = 0,
-    .needed = tlb_needed,
-    .fields = (const VMStateField[]) {
-        VMSTATE_STRUCT_ARRAY(env.tlb, LoongArchCPU, LOONGARCH_TLB_MAX,
-                             0, vmstate_tlb_entry, LoongArchTLB),
-        VMSTATE_END_OF_LIST()
-    }
-};
-#endif
-
 /* LoongArch CPU state */
 const VMStateDescription vmstate_loongarch_cpu = {
     .name = "cpu",
@@ -286,9 +254,6 @@ const VMStateDescription vmstate_loongarch_cpu = {
         &vmstate_fpu,
         &vmstate_lsx,
         &vmstate_lasx,
-#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
-        &vmstate_tlb,
-#endif
         &vmstate_lbt,
         &vmstate_msgint,
         &vmstate_pmu,
-- 
2.39.3