From patchwork Sun Oct 24 11:00:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 265372 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9OB0BFc008566 for ; Sun, 24 Oct 2010 11:00:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932451Ab0JXLAG (ORCPT ); Sun, 24 Oct 2010 07:00:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37859 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932370Ab0JXLAF (ORCPT ); Sun, 24 Oct 2010 07:00:05 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9OB047p019978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 24 Oct 2010 07:00:04 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o9OB03Gg032461; Sun, 24 Oct 2010 07:00:04 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 34B6618D46E; Sun, 24 Oct 2010 13:00:03 +0200 (IST) From: Gleb Natapov To: avi@redhat.com, mtosatti@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH 2/2] Fix cpu/pci hotplug to generate level triggered interrupt. Date: Sun, 24 Oct 2010 13:00:03 +0200 Message-Id: <1287918003-7359-2-git-send-email-gleb@redhat.com> In-Reply-To: <1287918003-7359-1-git-send-email-gleb@redhat.com> References: <1287918003-7359-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 24 Oct 2010 11:00:15 +0000 (UTC) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index 1db5ee3..de3bb88 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -111,7 +111,8 @@ static void pm_update_sci(PIIX4PMState *s) ACPI_BITMASK_POWER_BUTTON_ENABLE | ACPI_BITMASK_GLOBAL_LOCK_ENABLE | ACPI_BITMASK_TIMER_ENABLE)) != 0) || - (((s->gpe.sts & s->gpe.en) & PIIX4_PCI_HOTPLUG_STATUS) != 0); + (((s->gpe.sts & s->gpe.en) & + (PIIX4_CPU_HOTPLUG_STATUS | PIIX4_PCI_HOTPLUG_STATUS)) != 0); qemu_set_irq(s->irq, sci_level); /* schedule a timer interruption if needed */ @@ -610,20 +611,19 @@ static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev, int state); static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s) { - struct gpe_regs *gpe = &s->gpe; struct pci_status *pci0_status = &s->pci0_status; int i = 0, cpus = smp_cpus; while (cpus > 0) { - gpe->cpus_sts[i++] = (cpus < 8) ? (1 << cpus) - 1 : 0xff; + s->gpe.cpus_sts[i++] = (cpus < 8) ? (1 << cpus) - 1 : 0xff; cpus -= 8; } register_ioport_write(GPE_BASE, 4, 1, gpe_writeb, s); register_ioport_read(GPE_BASE, 4, 1, gpe_readb, s); - register_ioport_write(PROC_BASE, 32, 1, gpe_writeb, gpe); - register_ioport_read(PROC_BASE, 32, 1, gpe_readb, gpe); + register_ioport_write(PROC_BASE, 32, 1, gpe_writeb, s); + register_ioport_read(PROC_BASE, 32, 1, gpe_readb, s); register_ioport_write(PCI_BASE, 8, 4, pcihotplug_write, pci0_status); register_ioport_read(PCI_BASE, 8, 4, pcihotplug_read, pci0_status); @@ -665,10 +665,8 @@ void qemu_system_cpu_hot_add(int cpu, int state) enable_processor(&s->gpe, cpu); else disable_processor(&s->gpe, cpu); - if (s->gpe.en & 4) { - qemu_set_irq(s->irq, 1); - qemu_set_irq(s->irq, 0); - } + + pm_update_sci(s); } #endif