qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] target/loongarch/kvm: Fix VM recovery from disk failures
@ 2024-05-08  2:47 Song Gao
  2024-05-09 13:24 ` Peter Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Song Gao @ 2024-05-08  2:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: peterx, farosas, philmd, peter.maydell, richard.henderson,
	pbonzini, maobibo, zhaotianrui, lixianglai

vmstate does not save kvm_state_conter,
which can cause VM recovery from disk to fail.

Signed-off-by: Song Gao <gaosong@loongson.cn>
---
v2:
  - Update the version.
  - Link to v1: https://patchew.org/QEMU/20240430012356.2620763-1-gaosong@loongson.cn/
 target/loongarch/machine.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/loongarch/machine.c b/target/loongarch/machine.c
index c7029fb9b4..d6109e3b20 100644
--- a/target/loongarch/machine.c
+++ b/target/loongarch/machine.c
@@ -125,8 +125,8 @@ const VMStateDescription vmstate_tlb = {
 /* LoongArch CPU state */
 const VMStateDescription vmstate_loongarch_cpu = {
     .name = "cpu",
-    .version_id = 1,
-    .minimum_version_id = 1,
+    .version_id = 2,
+    .minimum_version_id = 2,
     .fields = (const VMStateField[]) {
         VMSTATE_UINTTL_ARRAY(env.gpr, LoongArchCPU, 32),
         VMSTATE_UINTTL(env.pc, LoongArchCPU),
@@ -191,6 +191,8 @@ const VMStateDescription vmstate_loongarch_cpu = {
         VMSTATE_STRUCT_ARRAY(env.tlb, LoongArchCPU, LOONGARCH_TLB_MAX,
                              0, vmstate_tlb, LoongArchTLB),
 
+        VMSTATE_UINT64(kvm_state_counter, LoongArchCPU),
+
         VMSTATE_END_OF_LIST()
     },
     .subsections = (const VMStateDescription * const []) {
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] target/loongarch/kvm: Fix VM recovery from disk failures
  2024-05-08  2:47 [PATCH v2] target/loongarch/kvm: Fix VM recovery from disk failures Song Gao
@ 2024-05-09 13:24 ` Peter Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Xu @ 2024-05-09 13:24 UTC (permalink / raw)
  To: Song Gao
  Cc: qemu-devel, farosas, philmd, peter.maydell, richard.henderson,
	pbonzini, maobibo, zhaotianrui, lixianglai

On Wed, May 08, 2024 at 10:47:32AM +0800, Song Gao wrote:
> vmstate does not save kvm_state_conter,
> which can cause VM recovery from disk to fail.
> 
> Signed-off-by: Song Gao <gaosong@loongson.cn>

Acked-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-09 13:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-08  2:47 [PATCH v2] target/loongarch/kvm: Fix VM recovery from disk failures Song Gao
2024-05-09 13:24 ` Peter Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).