All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org,
	Eric B Munson <emunson@mgebm.net>,
	Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: [PATCH 7/7] kvmclock: guest stop notification
Date: Thu, 12 Apr 2012 22:32:42 -0300	[thread overview]
Message-ID: <f349c12c0434e29c79ecde89029320c4002f7253.1334280761.git.mtosatti@redhat.com> (raw)
In-Reply-To: <cover.1334280761.git.mtosatti@redhat.com>

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>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
---
 hw/kvm/clock.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

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;
+            }
+        }
     }
 }
 
-- 
1.7.6.4


  parent reply	other threads:[~2012-04-13  1:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13  1:32 [PATCH 0/7] [PULL] qemu-kvm.git uq/master queue Marcelo Tosatti
2012-04-13  1:32 ` [PATCH 1/7] kvm: add flightrecorder script Marcelo Tosatti
2012-04-13  1:32 ` [PATCH 2/7] kvm: Drop redundant kvm_enabled from cpu_thread_is_idle Marcelo Tosatti
2012-04-13  1:32 ` [PATCH 3/7] kvm: allow arbitrarily sized mmio ioeventfd Marcelo Tosatti
2012-04-13  1:32 ` [PATCH 4/7] kvm: Drop unused kvm_pit_in_kernel Marcelo Tosatti
2012-04-13  1:32 ` [PATCH 5/7] kvm: set gsi_bits and max_gsi correctly Marcelo Tosatti
2012-04-13  1:32 ` [PATCH 6/7] kvm: update linux headers Marcelo Tosatti
2012-04-13  1:32 ` Marcelo Tosatti [this message]
2012-04-13 16:10 ` [Qemu-devel] [PATCH 0/7] [PULL] qemu-kvm.git uq/master queue Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f349c12c0434e29c79ecde89029320c4002f7253.1334280761.git.mtosatti@redhat.com \
    --to=mtosatti@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=emunson@mgebm.net \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=raghavendra.kt@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.