qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH V7] Guest stop notification
@ 2012-01-17 18:27 Eric B Munson
  2012-01-27 20:46 ` Eric B Munson
  2012-01-27 20:48 ` Anthony Liguori
  0 siblings, 2 replies; 5+ messages in thread
From: Eric B Munson @ 2012-01-17 18:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: ryanh, aliguori, kvm, Jan Kiszka, Marcelo Tosatti, Eric B Munson,
	Avi Kivity

Often when a guest is stopped from the qemu console, it will report spurious
soft lockup warnings on resume.  There are kernel patches being discussed that
will give the host the ability to tell the guest that it is being stopped and
should ignore the soft lockup warning that generates.  This patch uses the qemu
Notifier system to tell the guest it is about to be stopped.

Signed-off-by: Eric B Munson <emunson@mgebm.net>

Cc: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: ryanh@linux.vnet.ibm.com
Cc: aliguori@us.ibm.com
Cc: kvm@vger.kernel.org
---
Changes from V6:
 Remove unnecessary include

Changes from V5:
 KVM_GUEST_PAUSED is now a per vm ioctl instead of per vcpu

Changes from V4:
 Test if the guest paused capability is available before use

Changes from V3:
 Collapse new state change notification function into existsing function.
 Correct whitespace issues
 Change ioctl name to KVMCLOCK_GUEST_PAUSED
 Use for loop to iterate vpcu's

Changes from V2:
 Move ioctl into hw/kvmclock.c so as other arches can use it as it is
implemented

Changes from V1:
 Remove unnecessary encapsulating function

 hw/kvmclock.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/hw/kvmclock.c b/hw/kvmclock.c
index 3b9fb20..ad79f52 100644
--- a/hw/kvmclock.c
+++ b/hw/kvmclock.c
@@ -64,10 +64,21 @@ static int kvmclock_post_load(void *opaque, int version_id)
 static void kvmclock_vm_state_change(void *opaque, int running,
                                      RunState state)
 {
+    int ret;
     KVMClockState *s = opaque;
+    int cap_guest_paused = kvm_check_extension(kvm_state, KVM_CAP_GUEST_PAUSED);
 
     if (running) {
         s->clock_valid = false;
+
+        if (!cap_guest_paused) {
+            return;
+        }
+
+        ret = kvm_vm_ioctl(kvm_state, KVMCLOCK_GUEST_PAUSED, 0);
+        if (ret) {
+            fprintf(stderr, "kvmclock_vm_state_change: %s\n", strerror(-ret));
+        }
     }
 }
 
-- 
1.7.5.4

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

* Re: [Qemu-devel] [PATCH V7] Guest stop notification
  2012-01-17 18:27 [Qemu-devel] [PATCH V7] Guest stop notification Eric B Munson
@ 2012-01-27 20:46 ` Eric B Munson
  2012-01-27 20:48 ` Anthony Liguori
  1 sibling, 0 replies; 5+ messages in thread
From: Eric B Munson @ 2012-01-27 20:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: ryanh, aliguori, kvm, Jan Kiszka, Marcelo Tosatti, Avi Kivity

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

On Tue, 17 Jan 2012, Eric B Munson wrote:

> Often when a guest is stopped from the qemu console, it will report spurious
> soft lockup warnings on resume.  There are kernel patches being discussed that
> will give the host the ability to tell the guest that it is being stopped and
> should ignore the soft lockup warning that generates.  This patch uses the qemu
> Notifier system to tell the guest it is about to be stopped.
> 
> Signed-off-by: Eric B Munson <emunson@mgebm.net>

Just poking to make sure this doesn't fall through the cracks.

Eric

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [Qemu-devel] [PATCH V7] Guest stop notification
  2012-01-17 18:27 [Qemu-devel] [PATCH V7] Guest stop notification Eric B Munson
  2012-01-27 20:46 ` Eric B Munson
@ 2012-01-27 20:48 ` Anthony Liguori
  2012-01-27 21:49   ` Jan Kiszka
  1 sibling, 1 reply; 5+ messages in thread
From: Anthony Liguori @ 2012-01-27 20:48 UTC (permalink / raw)
  To: Eric B Munson
  Cc: ryanh, kvm, Jan Kiszka, Marcelo Tosatti, qemu-devel, Avi Kivity

On 01/17/2012 12:27 PM, Eric B Munson wrote:
> Often when a guest is stopped from the qemu console, it will report spurious
> soft lockup warnings on resume.  There are kernel patches being discussed that
> will give the host the ability to tell the guest that it is being stopped and
> should ignore the soft lockup warning that generates.  This patch uses the qemu
> Notifier system to tell the guest it is about to be stopped.
>
> Signed-off-by: Eric B Munson<emunson@mgebm.net>
>
> Cc: Avi Kivity<avi@redhat.com>
> Cc: Marcelo Tosatti<mtosatti@redhat.com>
> Cc: Jan Kiszka<jan.kiszka@siemens.com>
> Cc: ryanh@linux.vnet.ibm.com
> Cc: aliguori@us.ibm.com
> Cc: kvm@vger.kernel.org
> ---
> Changes from V6:
>   Remove unnecessary include
>
> Changes from V5:
>   KVM_GUEST_PAUSED is now a per vm ioctl instead of per vcpu
>
> Changes from V4:
>   Test if the guest paused capability is available before use
>
> Changes from V3:
>   Collapse new state change notification function into existsing function.
>   Correct whitespace issues
>   Change ioctl name to KVMCLOCK_GUEST_PAUSED
>   Use for loop to iterate vpcu's
>
> Changes from V2:
>   Move ioctl into hw/kvmclock.c so as other arches can use it as it is
> implemented
>
> Changes from V1:
>   Remove unnecessary encapsulating function
>
>   hw/kvmclock.c |   11 +++++++++++
>   1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/hw/kvmclock.c b/hw/kvmclock.c
> index 3b9fb20..ad79f52 100644
> --- a/hw/kvmclock.c
> +++ b/hw/kvmclock.c
> @@ -64,10 +64,21 @@ static int kvmclock_post_load(void *opaque, int version_id)
>   static void kvmclock_vm_state_change(void *opaque, int running,
>                                        RunState state)
>   {
> +    int ret;
>       KVMClockState *s = opaque;
> +    int cap_guest_paused = kvm_check_extension(kvm_state, KVM_CAP_GUEST_PAUSED);
>
>       if (running) {
>           s->clock_valid = false;
> +
> +        if (!cap_guest_paused) {
> +            return;
> +        }
> +
> +        ret = kvm_vm_ioctl(kvm_state, KVMCLOCK_GUEST_PAUSED, 0);
> +        if (ret) {
> +            fprintf(stderr, "kvmclock_vm_state_change: %s\n", strerror(-ret));
> +        }
>       }
>   }


This change looks harmless enough.  What's the state of the kernel bits?  I 
would expect this through uq/master.

Regards,

Anthony Liguori

>

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

* Re: [Qemu-devel] [PATCH V7] Guest stop notification
  2012-01-27 20:48 ` Anthony Liguori
@ 2012-01-27 21:49   ` Jan Kiszka
  2012-01-28  2:39     ` Alexander Graf
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2012-01-27 21:49 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: ryanh, kvm, Marcelo Tosatti, qemu-devel, Alexander Graf,
	Avi Kivity, Eric B Munson

[-- Attachment #1: Type: text/plain, Size: 2945 bytes --]

On 2012-01-27 21:48, Anthony Liguori wrote:
> On 01/17/2012 12:27 PM, Eric B Munson wrote:
>> Often when a guest is stopped from the qemu console, it will report
>> spurious
>> soft lockup warnings on resume.  There are kernel patches being
>> discussed that
>> will give the host the ability to tell the guest that it is being
>> stopped and
>> should ignore the soft lockup warning that generates.  This patch uses
>> the qemu
>> Notifier system to tell the guest it is about to be stopped.
>>
>> Signed-off-by: Eric B Munson<emunson@mgebm.net>
>>
>> Cc: Avi Kivity<avi@redhat.com>
>> Cc: Marcelo Tosatti<mtosatti@redhat.com>
>> Cc: Jan Kiszka<jan.kiszka@siemens.com>
>> Cc: ryanh@linux.vnet.ibm.com
>> Cc: aliguori@us.ibm.com
>> Cc: kvm@vger.kernel.org
>> ---
>> Changes from V6:
>>   Remove unnecessary include
>>
>> Changes from V5:
>>   KVM_GUEST_PAUSED is now a per vm ioctl instead of per vcpu
>>
>> Changes from V4:
>>   Test if the guest paused capability is available before use
>>
>> Changes from V3:
>>   Collapse new state change notification function into existsing
>> function.
>>   Correct whitespace issues
>>   Change ioctl name to KVMCLOCK_GUEST_PAUSED
>>   Use for loop to iterate vpcu's
>>
>> Changes from V2:
>>   Move ioctl into hw/kvmclock.c so as other arches can use it as it is
>> implemented
>>
>> Changes from V1:
>>   Remove unnecessary encapsulating function
>>
>>   hw/kvmclock.c |   11 +++++++++++
>>   1 files changed, 11 insertions(+), 0 deletions(-)
>>
>> diff --git a/hw/kvmclock.c b/hw/kvmclock.c
>> index 3b9fb20..ad79f52 100644
>> --- a/hw/kvmclock.c
>> +++ b/hw/kvmclock.c
>> @@ -64,10 +64,21 @@ static int kvmclock_post_load(void *opaque, int
>> version_id)
>>   static void kvmclock_vm_state_change(void *opaque, int running,
>>                                        RunState state)
>>   {
>> +    int ret;
>>       KVMClockState *s = opaque;
>> +    int cap_guest_paused = kvm_check_extension(kvm_state,
>> KVM_CAP_GUEST_PAUSED);
>>
>>       if (running) {
>>           s->clock_valid = false;
>> +
>> +        if (!cap_guest_paused) {
>> +            return;
>> +        }
>> +
>> +        ret = kvm_vm_ioctl(kvm_state, KVMCLOCK_GUEST_PAUSED, 0);
>> +        if (ret) {
>> +            fprintf(stderr, "kvmclock_vm_state_change: %s\n",
>> strerror(-ret));
>> +        }
>>       }
>>   }
> 
> 
> This change looks harmless enough.

Yep, but needs to be redirected after the file renaming in upstream.

>  What's the state of the kernel
> bits?  I would expect this through uq/master.

Kernel bits aren't merged yet. And the kernel headers will have to be
updated in a previous step.

BTW, this series [1] would be nice to have. Dunno if there is a pull
planned, but anyone trying to extend the KVM interface current runs
against this.

Jan

[1] http://thread.gmane.org/gmane.comp.emulators.qemu/132962


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

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

* Re: [Qemu-devel] [PATCH V7] Guest stop notification
  2012-01-27 21:49   ` Jan Kiszka
@ 2012-01-28  2:39     ` Alexander Graf
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2012-01-28  2:39 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: ryanh@linux.vnet.ibm.com, Anthony Liguori, kvm@vger.kernel.org,
	Marcelo Tosatti, qemu-devel@nongnu.org, Eric B Munson, Avi Kivity



On 27.01.2012, at 22:49, Jan Kiszka <jan.kiszka@web.de> wrote:

> On 2012-01-27 21:48, Anthony Liguori wrote:
>> On 01/17/2012 12:27 PM, Eric B Munson wrote:
>>> Often when a guest is stopped from the qemu console, it will report
>>> spurious
>>> soft lockup warnings on resume.  There are kernel patches being
>>> discussed that
>>> will give the host the ability to tell the guest that it is being
>>> stopped and
>>> should ignore the soft lockup warning that generates.  This patch uses
>>> the qemu
>>> Notifier system to tell the guest it is about to be stopped.
>>> 
>>> Signed-off-by: Eric B Munson<emunson@mgebm.net>
>>> 
>>> Cc: Avi Kivity<avi@redhat.com>
>>> Cc: Marcelo Tosatti<mtosatti@redhat.com>
>>> Cc: Jan Kiszka<jan.kiszka@siemens.com>
>>> Cc: ryanh@linux.vnet.ibm.com
>>> Cc: aliguori@us.ibm.com
>>> Cc: kvm@vger.kernel.org
>>> ---
>>> Changes from V6:
>>>  Remove unnecessary include
>>> 
>>> Changes from V5:
>>>  KVM_GUEST_PAUSED is now a per vm ioctl instead of per vcpu
>>> 
>>> Changes from V4:
>>>  Test if the guest paused capability is available before use
>>> 
>>> Changes from V3:
>>>  Collapse new state change notification function into existsing
>>> function.
>>>  Correct whitespace issues
>>>  Change ioctl name to KVMCLOCK_GUEST_PAUSED
>>>  Use for loop to iterate vpcu's
>>> 
>>> Changes from V2:
>>>  Move ioctl into hw/kvmclock.c so as other arches can use it as it is
>>> implemented
>>> 
>>> Changes from V1:
>>>  Remove unnecessary encapsulating function
>>> 
>>>  hw/kvmclock.c |   11 +++++++++++
>>>  1 files changed, 11 insertions(+), 0 deletions(-)
>>> 
>>> diff --git a/hw/kvmclock.c b/hw/kvmclock.c
>>> index 3b9fb20..ad79f52 100644
>>> --- a/hw/kvmclock.c
>>> +++ b/hw/kvmclock.c
>>> @@ -64,10 +64,21 @@ static int kvmclock_post_load(void *opaque, int
>>> version_id)
>>>  static void kvmclock_vm_state_change(void *opaque, int running,
>>>                                       RunState state)
>>>  {
>>> +    int ret;
>>>      KVMClockState *s = opaque;
>>> +    int cap_guest_paused = kvm_check_extension(kvm_state,
>>> KVM_CAP_GUEST_PAUSED);
>>> 
>>>      if (running) {
>>>          s->clock_valid = false;
>>> +
>>> +        if (!cap_guest_paused) {
>>> +            return;
>>> +        }
>>> +
>>> +        ret = kvm_vm_ioctl(kvm_state, KVMCLOCK_GUEST_PAUSED, 0);
>>> +        if (ret) {
>>> +            fprintf(stderr, "kvmclock_vm_state_change: %s\n",
>>> strerror(-ret));
>>> +        }
>>>      }
>>>  }
>> 
>> 
>> This change looks harmless enough.
> 
> Yep, but needs to be redirected after the file renaming in upstream.
> 
>> What's the state of the kernel
>> bits?  I would expect this through uq/master.
> 
> Kernel bits aren't merged yet. And the kernel headers will have to be
> updated in a previous step.
> 
> BTW, this series [1] would be nice to have. Dunno if there is a pull
> planned, but anyone trying to extend the KVM interface current runs
> against this.

Yeah, I was mostly waiting for acks/nacks. Since I didn't receive any, expect a pullreq next week.

Alex

> 
> Jan
> 
> [1] http://thread.gmane.org/gmane.comp.emulators.qemu/132962
> 

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

end of thread, other threads:[~2012-01-28  2:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-17 18:27 [Qemu-devel] [PATCH V7] Guest stop notification Eric B Munson
2012-01-27 20:46 ` Eric B Munson
2012-01-27 20:48 ` Anthony Liguori
2012-01-27 21:49   ` Jan Kiszka
2012-01-28  2:39     ` Alexander Graf

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).