From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dor Laor Subject: Re: [PATCH] Fix block mode during halt emulation Date: Tue, 01 Jul 2008 10:29:50 +0300 Message-ID: <1214897390.3796.3.camel@localhost.localdomain> References: <1214865008.11535.41.camel@localhost.localdomain> Reply-To: dor.laor@qumranet.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Avi Kivity , Yaniv Kamay To: kvm-devel Return-path: Received: from il.qumranet.com ([212.179.150.194]:49530 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752139AbYGAHbZ (ORCPT ); Tue, 1 Jul 2008 03:31:25 -0400 In-Reply-To: <1214865008.11535.41.camel@localhost.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: Well, it's obiosly creates a race, it was too late@night. The problem is that =EF=BB=BFkvm_cpu_has_interrupt() calls apic that ch= ecks if=20 the kvm_apic_accept_pic_intr and its true since probably the apic is masked on guest shutdown. There is no test whether the pic is masked.=20 Testing. On Tue, 2008-07-01 at 01:30 +0300, Dor Laor wrote: > >From d85feaae019bc0abc98a2524369e04d521a78aa8 Mon Sep 17 00:00:00 20= 01 > From: Dor Laor > Date: Mon, 30 Jun 2008 18:22:44 -0400 > Subject: [PATCH] Fix block mode hduring halt emulation >=20 > There is no need to check for pending pit/apic timer, nor > pending virq, since all of the check KVM_MP_STATE_RUNNABLE > and wakeup the waitqueue. >=20 > It fixes 100% cpu when windows guest is shutdown (non acpi HAL) >=20 > Signed-off-by: Dor Laor > --- > virt/kvm/kvm_main.c | 4 ---- > 1 files changed, 0 insertions(+), 4 deletions(-) >=20 > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index b90da0b..faa0778 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -816,10 +816,6 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu) > for (;;) { > prepare_to_wait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE); > =20 > - if (kvm_cpu_has_interrupt(vcpu)) > - break; > - if (kvm_cpu_has_pending_timer(vcpu)) > - break; > if (kvm_arch_vcpu_runnable(vcpu)) > break; > if (signal_pending(current))