From patchwork Wed Jun 3 18:25:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 27698 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n53IQD5a030661 for ; Wed, 3 Jun 2009 18:26:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754095AbZFCSZq (ORCPT ); Wed, 3 Jun 2009 14:25:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753989AbZFCSZp (ORCPT ); Wed, 3 Jun 2009 14:25:45 -0400 Received: from mx2.redhat.com ([66.187.237.31]:52123 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753450AbZFCSZo (ORCPT ); Wed, 3 Jun 2009 14:25:44 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n53IPldr006684 for ; Wed, 3 Jun 2009 14:25:47 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n53IPi6B011875; Wed, 3 Jun 2009 14:25:45 -0400 Received: from localhost.localdomain (virtlab1.virt.bos.redhat.com [10.16.72.21]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n53IPiJS026685; Wed, 3 Jun 2009 14:25:44 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH 1/4] avoid halted state for in kernel irqchip Date: Wed, 3 Jun 2009 14:25:41 -0400 Message-Id: <1244053544-12074-2-git-send-email-glommer@redhat.com> In-Reply-To: <1244053544-12074-1-git-send-email-glommer@redhat.com> References: <1244053544-12074-1-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This patch is part of a series that tries to provide a kvm-free apic implementation. In the last interation, Jan pointed out that halted state management with in kernel irqchip gets quite messy. I don't disagree. It broke this series specifically, as init IPIs had the halted state set. The solution would be to rework halted state management. But I'm too lazy. Besides, gleb told me he would do it, which makes it his problem, not mine. ;-) This patch can be used to bypass the problem entirely: if kvm apic do not call apic_init_ipi, but a version of it that does everything but mangling around with cpu states, the problem becomes a non issue, and my glorious series can be applied. Signed-off-by: Glauber Costa --- hw/apic.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/apic.c b/hw/apic.c index 86aa6b6..862289d 100644 --- a/hw/apic.c +++ b/hw/apic.c @@ -443,8 +443,7 @@ static void apic_get_delivery_bitmask(uint32_t *deliver_bitmask, } } - -static void apic_init_ipi(APICState *s) +static void apic_init_ipi_state(APICState *s) { int i; @@ -466,6 +465,11 @@ static void apic_init_ipi(APICState *s) s->next_time = 0; cpu_reset(s->cpu_env); +} + +static void apic_init_ipi(APICState *s) +{ + apic_init_ipi_state(s); if (!(s->apicbase & MSR_IA32_APICBASE_BSP) && (!kvm_enabled() || !qemu_kvm_irqchip_in_kernel()))