[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/7] kvmclock: guest stop notification
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [PATCH 7/7] kvmclock: guest stop notification |
Date: |
Thu, 12 Apr 2012 22:32:42 -0300 |
From: Eric B Munson <address@hidden>
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 <address@hidden>
Signed-off-by: Raghavendra K T <address@hidden>
Reviewed-by: Andreas Färber <address@hidden>
Signed-off-by: Marcelo Tosatti <address@hidden>
---
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
- [Qemu-devel] [PATCH 0/7] [PULL] qemu-kvm.git uq/master queue, Marcelo Tosatti, 2012/04/12
- [Qemu-devel] [PATCH 6/7] kvm: update linux headers, Marcelo Tosatti, 2012/04/12
- [Qemu-devel] [PATCH 2/7] kvm: Drop redundant kvm_enabled from cpu_thread_is_idle, Marcelo Tosatti, 2012/04/12
- [Qemu-devel] [PATCH 3/7] kvm: allow arbitrarily sized mmio ioeventfd, Marcelo Tosatti, 2012/04/12
- [Qemu-devel] [PATCH 1/7] kvm: add flightrecorder script, Marcelo Tosatti, 2012/04/12
- [Qemu-devel] [PATCH 5/7] kvm: set gsi_bits and max_gsi correctly, Marcelo Tosatti, 2012/04/12
- [Qemu-devel] [PATCH 7/7] kvmclock: guest stop notification,
Marcelo Tosatti <=
- [Qemu-devel] [PATCH 4/7] kvm: Drop unused kvm_pit_in_kernel, Marcelo Tosatti, 2012/04/12
- Re: [Qemu-devel] [PATCH 0/7] [PULL] qemu-kvm.git uq/master queue, Anthony Liguori, 2012/04/13