From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Smetanin Subject: [PATCH v1] kvm/x86: Remove Hyper-V SynIC timer stopping Date: Mon, 14 Dec 2015 18:33:05 +0300 Message-ID: <1450107185-31490-1-git-send-email-asmetanin@virtuozzo.com> Cc: Gleb Natapov , Paolo Bonzini , qemu-devel@nongnu.org, Roman Kagan , "Denis V. Lunev" To: kvm@vger.kernel.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org It's possible that guest send us Hyper-V EOM at the middle of Hyper-V SynIC timer running, so we start processing of Hyper-V SynIC timers in vcpu context and stop the Hyper-V SynIC timer uncoditionally and lose time expiration which Windows 2012R2 guest expects. The patch fixes such situation by not stopping Hyper-V SynIC timer at all, because it's safe to restart it without stop in vcpu context and timer callback always returns HRTIMER_NORESTART. Signed-off-by: Andrey Smetanin CC: Gleb Natapov CC: Paolo Bonzini CC: Roman Kagan CC: Denis V. Lunev CC: qemu-devel@nongnu.org --- arch/x86/kvm/hyperv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index 8ff8829..f34f666 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -598,7 +598,6 @@ void kvm_hv_process_stimers(struct kvm_vcpu *vcpu) for (i = 0; i < ARRAY_SIZE(hv_vcpu->stimer); i++) if (test_and_clear_bit(i, hv_vcpu->stimer_pending_bitmap)) { stimer = &hv_vcpu->stimer[i]; - stimer_stop(stimer); if (stimer->config & HV_STIMER_ENABLE) { time_now = get_time_ref_counter(vcpu->kvm); if (time_now >= stimer->exp_time) -- 2.4.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8V8E-0000fk-EX for qemu-devel@nongnu.org; Mon, 14 Dec 2015 10:33:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8V8A-0005fY-E0 for qemu-devel@nongnu.org; Mon, 14 Dec 2015 10:33:46 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:11350 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8V8A-0005cV-16 for qemu-devel@nongnu.org; Mon, 14 Dec 2015 10:33:42 -0500 From: Andrey Smetanin Date: Mon, 14 Dec 2015 18:33:05 +0300 Message-Id: <1450107185-31490-1-git-send-email-asmetanin@virtuozzo.com> Subject: [Qemu-devel] [PATCH v1] kvm/x86: Remove Hyper-V SynIC timer stopping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm@vger.kernel.org Cc: Gleb Natapov , Paolo Bonzini , qemu-devel@nongnu.org, Roman Kagan , "Denis V. Lunev" It's possible that guest send us Hyper-V EOM at the middle of Hyper-V SynIC timer running, so we start processing of Hyper-V SynIC timers in vcpu context and stop the Hyper-V SynIC timer uncoditionally and lose time expiration which Windows 2012R2 guest expects. The patch fixes such situation by not stopping Hyper-V SynIC timer at all, because it's safe to restart it without stop in vcpu context and timer callback always returns HRTIMER_NORESTART. Signed-off-by: Andrey Smetanin CC: Gleb Natapov CC: Paolo Bonzini CC: Roman Kagan CC: Denis V. Lunev CC: qemu-devel@nongnu.org --- arch/x86/kvm/hyperv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index 8ff8829..f34f666 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -598,7 +598,6 @@ void kvm_hv_process_stimers(struct kvm_vcpu *vcpu) for (i = 0; i < ARRAY_SIZE(hv_vcpu->stimer); i++) if (test_and_clear_bit(i, hv_vcpu->stimer_pending_bitmap)) { stimer = &hv_vcpu->stimer[i]; - stimer_stop(stimer); if (stimer->config & HV_STIMER_ENABLE) { time_now = get_time_ref_counter(vcpu->kvm); if (time_now >= stimer->exp_time) -- 2.4.3