diff mbox

[4/4] PCI hotplug fixes

Message ID 20090205134256.20515.84712.stgit@dhcp-1-237.tlv.redhat.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Gleb Natapov Feb. 5, 2009, 1:42 p.m. UTC
Generate interrupt only if corespondent EN bit is set.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
---

 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

Comments

Marcelo Tosatti Feb. 10, 2009, 12:36 a.m. UTC | #1
On Thu, Feb 05, 2009 at 03:42:57PM +0200, Gleb Natapov wrote:
> Generate interrupt only if corespondent EN bit is set.
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> ---
> 
>  qemu/hw/acpi.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)

Acked-by: Marcelo Tosatti <mtosatti@redhat.com>

--
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 mbox

Patch

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);
+    }
 }