All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V9 1/1] Guest stop notification
@ 2012-04-07  0:47 Raghavendra K T
  2012-04-07 10:53 ` Andreas Färber
  2012-04-12  3:46 ` Marcelo Tosatti
  0 siblings, 2 replies; 3+ messages in thread
From: Raghavendra K T @ 2012-04-07  0:47 UTC (permalink / raw)
  To: Anthony Liguori, Jan Kiszka, Qemu-devel, Andreas Färber
  Cc: Marcelo Tosatti, KVM, Raghavendra K T, Srivatsa Vaddagiri,
	Michael J. Wolf, Avi Kivity, Eric B Munson

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2733 bytes --]

From: Eric B Munson <emunson@mgebm.net>

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> 
Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>

Cc: Eric B Munson <emunson@mgebm.net>
Cc: Avi Kivity <avi@redhat.com> 
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Andreas Färber <afaerber@suse.de>
---
Changes from V8:
 incorporated Andrea's comments: 
  use __func__ in place of actual function name 
  change ret variable order
  no whitespace before %s in fprintf   

Changes from V7:
 capabilty changed to KVM_CAP_KVMCLOCK_CTRL
 KVM_GUEST_PAUSED is pervcpu again
 CPUState renamed to CPUArchState
 KVMCLOCK_GUEST_PAUSED changed to  KVM_KVMCLOCK_CTRL

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
---
not included Andreas's Reviewed by since used __func__ instead of __FUNCTION__
V8 of the patch was Reviewed-by: Andreas Färber <afaerber@suse.de>

diff --git a/hw/kvm/clock.c b/hw/kvm/clock.c
index 446bd62..824b978 100644
--- a/hw/kvm/clock.c
+++ b/hw/kvm/clock.c
@@ -65,9 +65,25 @@ static void kvmclock_vm_state_change(void *opaque, int running,
                                      RunState state)
 {
     KVMClockState *s = opaque;
+    CPUArchState *penv = first_cpu;
+    int cap_clock_ctrl = kvm_check_extension(kvm_state, KVM_CAP_KVMCLOCK_CTRL);
+    int ret;
 
     if (running) {
         s->clock_valid = false;
+
+        if (!cap_clock_ctrl) {
+            return;
+        }
+        for (penv = first_cpu; penv != NULL; penv = penv->next_cpu) {
+            ret = kvm_vcpu_ioctl(penv, KVM_KVMCLOCK_CTRL, 0);
+            if (ret) {
+                if (ret != -EINVAL) {
+                    fprintf(stderr, "%s: %s\n", __func__, strerror(-ret));
+                }
+                return;
+            }
+        }
     }
 }
 

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

* Re: [PATCH V9 1/1] Guest stop notification
  2012-04-07  0:47 [PATCH V9 1/1] Guest stop notification Raghavendra K T
@ 2012-04-07 10:53 ` Andreas Färber
  2012-04-12  3:46 ` Marcelo Tosatti
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Färber @ 2012-04-07 10:53 UTC (permalink / raw)
  To: Raghavendra K T
  Cc: Anthony Liguori, KVM, Jan Kiszka, Marcelo Tosatti, Qemu-devel,
	Srivatsa Vaddagiri, Michael J. Wolf, Avi Kivity, Eric B Munson

Am 07.04.2012 02:47, schrieb Raghavendra K T:
> From: Eric B Munson <emunson@mgebm.net>
> 
> 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> 
> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>

Reviewed-by: Andreas Färber <afaerber@suse.de>

Thanks,
Andreas

P.S. No need to resend now, you'll either get more comments or someone
will apply it to uq/master or master. Note that there's public holidays
in Germany and Israel.

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

* Re: [PATCH V9 1/1] Guest stop notification
  2012-04-07  0:47 [PATCH V9 1/1] Guest stop notification Raghavendra K T
  2012-04-07 10:53 ` Andreas Färber
@ 2012-04-12  3:46 ` Marcelo Tosatti
  1 sibling, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2012-04-12  3:46 UTC (permalink / raw)
  To: Raghavendra K T
  Cc: Anthony Liguori, KVM, Jan Kiszka, Srivatsa Vaddagiri, Qemu-devel,
	Michael J. Wolf, Avi Kivity, Andreas Färber, Eric B Munson

On Sat, Apr 07, 2012 at 06:17:47AM +0530, Raghavendra K T wrote:
> From: Eric B Munson <emunson@mgebm.net>
> 
> 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> 
> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>

Applied, thanks.

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

end of thread, other threads:[~2012-04-12  3:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-07  0:47 [PATCH V9 1/1] Guest stop notification Raghavendra K T
2012-04-07 10:53 ` Andreas Färber
2012-04-12  3:46 ` Marcelo Tosatti

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.