qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 6/7] Prepare ACPI infrastructure for cpu hot-plu


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH 6/7] Prepare ACPI infrastructure for cpu hot-plug in acpi_piix4
Date: Thu, 16 Feb 2012 12:41:46 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

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 <address@hidden>
> ---
>  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]