From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxzih-0001dz-2f for qemu-devel@nongnu.org; Thu, 16 Feb 2012 06:41:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rxzif-0001bi-8d for qemu-devel@nongnu.org; Thu, 16 Feb 2012 06:41:51 -0500 Received: from thoth.sbs.de ([192.35.17.2]:20275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxzie-0001bQ-Oi for qemu-devel@nongnu.org; Thu, 16 Feb 2012 06:41:49 -0500 Message-ID: <4F3CEB7A.8080503@siemens.com> Date: Thu, 16 Feb 2012 12:41:46 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <1329347774-23262-1-git-send-email-imammedo@redhat.com> <1329347774-23262-7-git-send-email-imammedo@redhat.com> In-Reply-To: <1329347774-23262-7-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/7] Prepare ACPI infrastructure for cpu hot-plug in acpi_piix4 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: "qemu-devel@nongnu.org" , "gleb@redhat.com" On 2012-02-16 00:16, Igor Mammedov wrote: > It's backport of acpi related cpu-hotplug code from qemu-kvm. > Provides means to communicate cpu hot-plug events to guest OS > and that works with current seabios. > > Signed-off-by: Igor Mammedov > --- > hw/acpi_piix4.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++- > hw/pc.h | 1 + > 2 files changed, 64 insertions(+), 2 deletions(-) > > diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c > index bdc55a1..5a83d73 100644 > --- a/hw/acpi_piix4.c > +++ b/hw/acpi_piix4.c > @@ -43,9 +43,15 @@ > #define PCI_BASE 0xae00 > #define PCI_EJ_BASE 0xae08 > #define PCI_RMV_BASE 0xae0c > +#define PROC_BASE 0xaf00 > > +#define PIIX4_CPU_HOTPLUG_STATUS 4 > #define PIIX4_PCI_HOTPLUG_STATUS 2 > > +struct gpe_regs { > + uint8_t cpus_sts[32]; > +}; > + > struct pci_status { > uint32_t up; > uint32_t down; > @@ -71,6 +77,7 @@ typedef struct PIIX4PMState { > > /* for pci hotplug */ > ACPIGPE gpe; > + struct gpe_regs gpe_cpu; > struct pci_status pci0_status; > uint32_t pci0_hotplug_enable; > } PIIX4PMState; > @@ -90,7 +97,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[0] & s->gpe.en[0]) & PIIX4_PCI_HOTPLUG_STATUS) != 0); > + (((s->gpe.sts[0] & s->gpe.en[0]) & > + (PIIX4_PCI_HOTPLUG_STATUS | PIIX4_CPU_HOTPLUG_STATUS)) != 0); > > qemu_set_irq(s->irq, sci_level); > /* schedule a timer interruption if needed */ > @@ -329,11 +337,16 @@ static void piix4_pm_machine_ready(Notifier *n, void *opaque) > > } > > +static PIIX4PMState *global_piix4_pm_state; /* cpu hotadd */ > + Better establish a relation between the ICC bus and the PIIX4 so that the latter can provide this reference. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux