From patchwork Thu Feb 5 13:42:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 5643 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 n15DjP8I019214 for ; Thu, 5 Feb 2009 13:45:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755048AbZBENpX (ORCPT ); Thu, 5 Feb 2009 08:45:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755835AbZBENpX (ORCPT ); Thu, 5 Feb 2009 08:45:23 -0500 Received: from mx2.redhat.com ([66.187.237.31]:53986 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755048AbZBENpW (ORCPT ); Thu, 5 Feb 2009 08:45:22 -0500 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 n15DjMNC024826 for ; Thu, 5 Feb 2009 08:45:22 -0500 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 n15DjLpY002717; Thu, 5 Feb 2009 08:45:22 -0500 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n15DjKNm009674; Thu, 5 Feb 2009 08:45:20 -0500 Received: from dhcp-1-237.tlv.redhat.com (localhost [127.0.0.1]) by dhcp-1-237.tlv.redhat.com (Postfix) with ESMTP id 0688618D43A; Thu, 5 Feb 2009 15:42:57 +0200 (IST) From: Gleb Natapov Subject: [PATCH 4/4] PCI hotplug fixes To: avi@redhat.com Cc: kvm@vger.kernel.org Date: Thu, 05 Feb 2009 15:42:57 +0200 Message-ID: <20090205134256.20515.84712.stgit@dhcp-1-237.tlv.redhat.com> In-Reply-To: <20090205134240.20515.10999.stgit@dhcp-1-237.tlv.redhat.com> References: <20090205134240.20515.10999.stgit@dhcp-1-237.tlv.redhat.com> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 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 Generate interrupt only if corespondent EN bit is set. Signed-off-by: Gleb Natapov Acked-by: Marcelo Tosatti --- qemu/hw/acpi.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c index c2c60ad..fcb02a5 100644 --- a/qemu/hw/acpi.c +++ b/qemu/hw/acpi.c @@ -814,25 +814,26 @@ void qemu_system_cpu_hot_add(int cpu, int state) static void enable_device(struct pci_status *p, struct gpe_regs *g, int slot) { g->sts |= 2; - g->en |= 2; p->up |= (1 << slot); } static void disable_device(struct pci_status *p, struct gpe_regs *g, int slot) { g->sts |= 2; - g->en |= 2; p->down |= (1 << slot); } void qemu_system_device_hot_add(int pcibus, int slot, int state) { - qemu_set_irq(pm_state->irq, 1); pci0_status.up = 0; pci0_status.down = 0; if (state) enable_device(&pci0_status, &gpe, slot); else disable_device(&pci0_status, &gpe, slot); - qemu_set_irq(pm_state->irq, 0); + + if (gpe.en & 2) { + qemu_set_irq(pm_state->irq, 1); + qemu_set_irq(pm_state->irq, 0); + } }