From patchwork Wed Feb 4 09:58:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 5368 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 n14A0fEl016621 for ; Wed, 4 Feb 2009 10:00:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752206AbZBDKAi (ORCPT ); Wed, 4 Feb 2009 05:00:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752224AbZBDKAi (ORCPT ); Wed, 4 Feb 2009 05:00:38 -0500 Received: from mx2.redhat.com ([66.187.237.31]:52277 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751627AbZBDKAi (ORCPT ); Wed, 4 Feb 2009 05:00:38 -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 n14A0bKc002293 for ; Wed, 4 Feb 2009 05:00:37 -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 n14A0buA027011; Wed, 4 Feb 2009 05:00:37 -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 n14A0ajI030323; Wed, 4 Feb 2009 05:00:37 -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 3773618D43A; Wed, 4 Feb 2009 11:58:16 +0200 (IST) From: Gleb Natapov Subject: [PATCH 3/3] PCI hotplug fixes To: avi@redhat.com Cc: kvm@vger.kernel.org Date: Wed, 04 Feb 2009 11:58:16 +0200 Message-ID: <20090204095816.6892.43143.stgit@dhcp-1-237.tlv.redhat.com> In-Reply-To: <20090204095805.6892.47195.stgit@dhcp-1-237.tlv.redhat.com> References: <20090204095805.6892.47195.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 --- 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 83079fa..337432a 100644 --- a/qemu/hw/acpi.c +++ b/qemu/hw/acpi.c @@ -819,25 +819,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); + } }