diff mbox series

[PULL,01/10] target/loongarch/kvm: Fix VM recovery from disk failures

Message ID 20240523014637.614872-2-gaosong@loongson.cn (mailing list archive)
State New, archived
Headers show
Series [PULL,01/10] target/loongarch/kvm: Fix VM recovery from disk failures | expand

Commit Message

gaosong May 23, 2024, 1:46 a.m. UTC
vmstate does not save kvm_state_conter,
which can cause VM recovery from disk to fail.

Cc: qemu-stable@nongnu.org
Signed-off-by: Song Gao <gaosong@loongson.cn>
Acked-by: Peter Xu <peterx@redhat.com>
Message-Id: <20240508024732.3127792-1-gaosong@loongson.cn>
---
 target/loongarch/machine.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Michael Tokarev May 24, 2024, 10 a.m. UTC | #1
23.05.2024 04:46, Song Gao wrote:
> vmstate does not save kvm_state_conter,
> which can cause VM recovery from disk to fail.
> 
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> Acked-by: Peter Xu <peterx@redhat.com>
> Message-Id: <20240508024732.3127792-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 9cd9e848d6..08a7fa5370 100644
> --- a/target/loongarch/machine.c
> +++ b/target/loongarch/machine.c
> @@ -145,8 +145,8 @@ static 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),
> @@ -208,6 +208,8 @@ const VMStateDescription vmstate_loongarch_cpu = {
>           VMSTATE_UINT64(env.CSR_DERA, LoongArchCPU),
>           VMSTATE_UINT64(env.CSR_DSAVE, LoongArchCPU),
>   
> +        VMSTATE_UINT64(kvm_state_counter, LoongArchCPU),
> +
>           VMSTATE_END_OF_LIST()
>       },
>       .subsections = (const VMStateDescription * const []) {

Should this really be part of any stable releases?
Wouldn't it break migration between, say, 8.2 with this change
and without?

Thanks,

/mjt
gaosong May 27, 2024, 1:54 a.m. UTC | #2
在 2024/5/24 下午6:00, Michael Tokarev 写道:
> 23.05.2024 04:46, Song Gao wrote:
>> vmstate does not save kvm_state_conter,
>> which can cause VM recovery from disk to fail.
>>
>> Cc: qemu-stable@nongnu.org
>> Signed-off-by: Song Gao <gaosong@loongson.cn>
>> Acked-by: Peter Xu <peterx@redhat.com>
>> Message-Id: <20240508024732.3127792-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 9cd9e848d6..08a7fa5370 100644
>> --- a/target/loongarch/machine.c
>> +++ b/target/loongarch/machine.c
>> @@ -145,8 +145,8 @@ static 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),
>> @@ -208,6 +208,8 @@ const VMStateDescription vmstate_loongarch_cpu = {
>>           VMSTATE_UINT64(env.CSR_DERA, LoongArchCPU),
>>           VMSTATE_UINT64(env.CSR_DSAVE, LoongArchCPU),
>>   +        VMSTATE_UINT64(kvm_state_counter, LoongArchCPU),
>> +
>>           VMSTATE_END_OF_LIST()
>>       },
>>       .subsections = (const VMStateDescription * const []) {
>
> Should this really be part of any stable releases?
[...]
>
> Wouldn't it break migration between, say, 8.2 with this change
> and without?
Yes, I didn't take this into consideration, please ignore this patch.

Thanks.
Song Gao
> Thanks,
>
> /mjt
diff mbox series

Patch

diff --git a/target/loongarch/machine.c b/target/loongarch/machine.c
index 9cd9e848d6..08a7fa5370 100644
--- a/target/loongarch/machine.c
+++ b/target/loongarch/machine.c
@@ -145,8 +145,8 @@  static 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),
@@ -208,6 +208,8 @@  const VMStateDescription vmstate_loongarch_cpu = {
         VMSTATE_UINT64(env.CSR_DERA, LoongArchCPU),
         VMSTATE_UINT64(env.CSR_DSAVE, LoongArchCPU),
 
+        VMSTATE_UINT64(kvm_state_counter, LoongArchCPU),
+
         VMSTATE_END_OF_LIST()
     },
     .subsections = (const VMStateDescription * const []) {