All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/intc/arm_gicv3_its: Fix the VM termination in vm_change_state_handler()
@ 2017-11-03 12:37 Shanker Donthineni
  2017-11-06  7:30 ` Auger Eric
  0 siblings, 1 reply; 3+ messages in thread
From: Shanker Donthineni @ 2017-11-03 12:37 UTC (permalink / raw)
  To: Eric Auger, Peter Maydell; +Cc: qemu-arm, qemu-devel, Shanker Donthineni

The commit cddafd8f353d ("hw/intc/arm_gicv3_its: Implement state save
/restore") breaks the backward compatibility with the older kernels
where vITS save/restore support is not available. The vmstate function
vm_change_state_handler() should not be registered if the running kernel
doesn't support ITS save/restore feature. Otherwise VM instance will be
killed whenever vmstate callback function is invoked.

Observed a virtual machine shutdown with QEMU-2.10+linux-4.11 when testing
the reboot command "virsh reboot <domain> --mode acpi" instead of reboot.

KVM Error: 'KVM_SET_DEVICE_ATTR failed: Group 4 attr 0x00000000000001'

Signed-off-by: Shanker Donthineni <shankerd@codeaurora.org>
---
 hw/intc/arm_gicv3_its_kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c
index 39903d5..9b00ce5 100644
--- a/hw/intc/arm_gicv3_its_kvm.c
+++ b/hw/intc/arm_gicv3_its_kvm.c
@@ -111,13 +111,13 @@ static void kvm_arm_its_realize(DeviceState *dev, Error **errp)
             error_free(s->migration_blocker);
             return;
         }
+    } else {
+        qemu_add_vm_change_state_handler(vm_change_state_handler, s);
     }
 
     kvm_msi_use_devid = true;
     kvm_gsi_direct_mapping = false;
     kvm_msi_via_irqfd_allowed = kvm_irqfds_enabled();
-
-    qemu_add_vm_change_state_handler(vm_change_state_handler, s);
 }
 
 /**
-- 
Qualcomm Datacenter Technologies, Inc. on behalf of the Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

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

* Re: [Qemu-devel] [PATCH] hw/intc/arm_gicv3_its: Fix the VM termination in vm_change_state_handler()
  2017-11-03 12:37 [Qemu-devel] [PATCH] hw/intc/arm_gicv3_its: Fix the VM termination in vm_change_state_handler() Shanker Donthineni
@ 2017-11-06  7:30 ` Auger Eric
  2017-11-06 10:38   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Auger Eric @ 2017-11-06  7:30 UTC (permalink / raw)
  To: Shanker Donthineni, Peter Maydell; +Cc: qemu-arm, qemu-devel

Hi Shanker,

On 03/11/2017 13:37, Shanker Donthineni wrote:
> The commit cddafd8f353d ("hw/intc/arm_gicv3_its: Implement state save
> /restore") breaks the backward compatibility with the older kernels
> where vITS save/restore support is not available. The vmstate function
> vm_change_state_handler() should not be registered if the running kernel
> doesn't support ITS save/restore feature. Otherwise VM instance will be
> killed whenever vmstate callback function is invoked.
> 
> Observed a virtual machine shutdown with QEMU-2.10+linux-4.11 when testing
> the reboot command "virsh reboot <domain> --mode acpi" instead of reboot.
> 
> KVM Error: 'KVM_SET_DEVICE_ATTR failed: Group 4 attr 0x00000000000001'
> 
> Signed-off-by: Shanker Donthineni <shankerd@codeaurora.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>

Thanks for the fix.

Best Regards

Eric
> ---
>  hw/intc/arm_gicv3_its_kvm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c
> index 39903d5..9b00ce5 100644
> --- a/hw/intc/arm_gicv3_its_kvm.c
> +++ b/hw/intc/arm_gicv3_its_kvm.c
> @@ -111,13 +111,13 @@ static void kvm_arm_its_realize(DeviceState *dev, Error **errp)
>              error_free(s->migration_blocker);
>              return;
>          }
> +    } else {
> +        qemu_add_vm_change_state_handler(vm_change_state_handler, s);
>      }
>  
>      kvm_msi_use_devid = true;
>      kvm_gsi_direct_mapping = false;
>      kvm_msi_via_irqfd_allowed = kvm_irqfds_enabled();
> -
> -    qemu_add_vm_change_state_handler(vm_change_state_handler, s);
>  }
>  
>  /**
> 

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

* Re: [Qemu-devel] [PATCH] hw/intc/arm_gicv3_its: Fix the VM termination in vm_change_state_handler()
  2017-11-06  7:30 ` Auger Eric
@ 2017-11-06 10:38   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2017-11-06 10:38 UTC (permalink / raw)
  To: Auger Eric; +Cc: Shanker Donthineni, qemu-arm, qemu-devel

On 6 November 2017 at 07:30, Auger Eric <eric.auger@redhat.com> wrote:
> Hi Shanker,
>
> On 03/11/2017 13:37, Shanker Donthineni wrote:
>> The commit cddafd8f353d ("hw/intc/arm_gicv3_its: Implement state save
>> /restore") breaks the backward compatibility with the older kernels
>> where vITS save/restore support is not available. The vmstate function
>> vm_change_state_handler() should not be registered if the running kernel
>> doesn't support ITS save/restore feature. Otherwise VM instance will be
>> killed whenever vmstate callback function is invoked.
>>
>> Observed a virtual machine shutdown with QEMU-2.10+linux-4.11 when testing
>> the reboot command "virsh reboot <domain> --mode acpi" instead of reboot.
>>
>> KVM Error: 'KVM_SET_DEVICE_ATTR failed: Group 4 attr 0x00000000000001'
>>
>> Signed-off-by: Shanker Donthineni <shankerd@codeaurora.org>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>



Applied to target-arm.next, thanks.

-- PMM

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

end of thread, other threads:[~2017-11-06 10:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-03 12:37 [Qemu-devel] [PATCH] hw/intc/arm_gicv3_its: Fix the VM termination in vm_change_state_handler() Shanker Donthineni
2017-11-06  7:30 ` Auger Eric
2017-11-06 10:38   ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.