All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Igor Mammedov <imammedo@redhat.com>
Cc: peter.maydell@linaro.org, aliguori@us.ibm.com,
	ehabkost@redhat.com, mst@redhat.com,
	stefano.stabellini@eu.citrix.com, qemu-devel@nongnu.org,
	quintela@redhat.com, anthony.perard@citrix.com,
	pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH 03/15] acpi_piix4: add infrastructure to send CPU hot-plug GPE to guest
Date: Thu, 25 Apr 2013 17:54:50 +0200	[thread overview]
Message-ID: <517951CA.4080309@suse.de> (raw)
In-Reply-To: <1366898737-6201-4-git-send-email-imammedo@redhat.com>

Am 25.04.2013 16:05, schrieb Igor Mammedov:
> * introduce processor status bitmask visible to guest at 0xaf00 addr,
>   where ACPI asl code expects it
> * set bit corresponding to APIC ID in processor status bitmask on
>   receiving CPU hot-plug notification
> * trigger CPU hot-plug SCI, to notify guest about CPU hot-plug event
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> Note:
>   gpe_cpu.sts isn't need to be migrated, since CPU hotpluging during
>   migration just doesn't work, since destination QEMU has to be started
>   with all present in guest CPUs (including hotplugged).
>   i.e. src-qemu -smp 2,max-cpus=4; cpu-add id=2; dst-qemu -smp 3,max-cpus=4
>   Destination QEMU will recreate the same gpe_cpu.sts=t'111' bitmap as
>   on source by calling qemu_for_each_cpu(piix4_init_cpu_status, &s->gpe_cpu);
>   since it has been started with 3 CPUs on command line.
> 
> v7:
>   * s/struct cpu_status/struct CPUStatus/
> v6:
>   * drop gpe_cpu.sts migration hunks
> v5:
>   * add optional vmstate subsection if there was CPU hotplug event
>   * remove unused Error*
>   * use qemu_for_each_cpu() instead of recursion over QOM tree
> v4:
>   * added spec for QEMU-Seabios interface
>   * added PIIX4_ prefix to PROC_ defines
> v3:
>   * s/get_firmware_id()/get_arch_id()/ due rebase
>   * s/cpu_add_notifier/cpu_added_notifier/
> v2:
>   * use CPUClass.get_firmware_id() to make code target independent
>   * bump up vmstate_acpi version
> ---
>  docs/specs/acpi_cpu_hotplug.txt |   22 +++++++++
>  hw/acpi/piix4.c                 |   90 ++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 110 insertions(+), 2 deletions(-)
>  create mode 100644 docs/specs/acpi_cpu_hotplug.txt

Thanks, since it no longer depends on migration discussions, applied to
qom-cpu (with changes below: struct typedef and symmetric read/write):

https://github.com/afaerber/qemu-cpu/commits/qom-cpu

Andreas

diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index ebd1af9..c4af1cc 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -59,9 +59,9 @@ struct pci_status {
     uint32_t down;
 };

-struct CPUStatus {
+typedef struct CPUStatus {
     uint8_t sts[PIIX4_PROC_LEN];
-};
+} CPUStatus;

 typedef struct PIIX4PMState {
     PCIDevice dev;
@@ -92,7 +92,7 @@ typedef struct PIIX4PMState {
     uint8_t disable_s4;
     uint8_t s4_val;

-    struct CPUStatus gpe_cpu;
+    CPUStatus gpe_cpu;
     Notifier cpu_added_notifier;
 } PIIX4PMState;

@@ -597,10 +597,10 @@ static const MemoryRegionOps piix4_pci_ops = {
     },
 };

-static uint64_t cpu_status_read(void *opaque, hwaddr addr, unsigned width)
+static uint64_t cpu_status_read(void *opaque, hwaddr addr, unsigned int
size)
 {
     PIIX4PMState *s = opaque;
-    struct CPUStatus *cpus = &s->gpe_cpu;
+    CPUStatus *cpus = &s->gpe_cpu;
     uint64_t val = cpus->sts[addr];

     return val;
@@ -630,7 +630,7 @@ typedef enum {
 static void piix4_cpu_hotplug_req(PIIX4PMState *s, CPUState *cpu,
                                   HotplugEventType action)
 {
-    struct CPUStatus *g = &s->gpe_cpu;
+    CPUStatus *g = &s->gpe_cpu;
     ACPIGPE *gpe = &s->ar.gpe;
     CPUClass *k = CPU_GET_CLASS(cpu);
     int64_t cpu_id;
@@ -656,7 +656,7 @@ static void piix4_cpu_added_req(Notifier *n, void
*opaque)

 static void piix4_init_cpu_status(CPUState *cpu, void *data)
 {
-    struct CPUStatus *g = (struct CPUStatus *)data;
+    CPUStatus *g = (CPUStatus *)data;
     CPUClass *k = CPU_GET_CLASS(cpu);
     int64_t id = k->get_arch_id(cpu);



-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2013-04-25 15:54 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-25 14:05 [Qemu-devel] [PATCH 00/15 v6 for 1.5] target-i386: CPU hot-add with cpu-add QMP command Igor Mammedov
2013-04-25 14:05 ` [Qemu-devel] [PATCH 01/15] exec: add qemu_for_each_cpu Igor Mammedov
2013-04-25 15:04   ` Andreas Färber
2013-04-25 14:05 ` [Qemu-devel] [PATCH 02/15] cpu: add helper cpu_exists(), to check if CPU with specified id exists Igor Mammedov
2013-04-25 15:46   ` Andreas Färber
2013-04-25 14:05 ` [Qemu-devel] [PATCH 03/15] acpi_piix4: add infrastructure to send CPU hot-plug GPE to guest Igor Mammedov
2013-04-25 15:54   ` Andreas Färber [this message]
2013-04-25 14:05 ` [Qemu-devel] [PATCH 04/15] target-i386: introduce apic-id property Igor Mammedov
2013-04-25 20:36   ` Eduardo Habkost
2013-04-26  7:32     ` Igor Mammedov
2013-04-26  8:53       ` Eduardo Habkost
2013-04-26  9:34         ` Igor Mammedov
2013-04-26 16:05   ` Eduardo Habkost
2013-04-26 16:46   ` Andreas Färber
2013-04-26 17:29     ` [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized Igor Mammedov
2013-04-26 17:33       ` Eduardo Habkost
2013-04-26 17:39       ` Andreas Färber
2013-04-26 17:48         ` Igor Mammedov
2013-04-26 17:51         ` [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id once " Igor Mammedov
2013-04-27 15:50           ` Andreas Färber
2013-04-25 14:05 ` [Qemu-devel] [PATCH 05/15] target-i386: introduce ICC bus/device/bridge Igor Mammedov
2013-04-27 16:18   ` Andreas Färber
2013-04-25 14:05 ` [Qemu-devel] [PATCH 06/15] target-i386: cpu: attach ICC bus to CPU on its creation Igor Mammedov
2013-04-25 14:05 ` [Qemu-devel] [PATCH 07/15] target-i386: replace MSI_SPACE_SIZE with APIC_SPACE_SIZE Igor Mammedov
2013-04-28  0:37   ` Andreas Färber
2013-04-25 14:05 ` [Qemu-devel] [PATCH 08/15] target-i386: kvmvapic: make expilict dependency on sysbus.h Igor Mammedov
2013-04-28  0:46   ` Andreas Färber
2013-04-25 14:05 ` [Qemu-devel] [PATCH 09/15] target-i386: move APIC to ICC bus Igor Mammedov
2013-04-25 14:05 ` [Qemu-devel] [PATCH 10/15] extend memory_region_find() and use it in kvm/ioapic Igor Mammedov
2013-04-25 14:05 ` [Qemu-devel] [PATCH 11/15] target-i386: move IOAPIC to ICC bus Igor Mammedov
2013-04-25 14:05 ` [Qemu-devel] [PATCH 12/15] pc: pass QEMUMachineInitArgs down to pc_cpus_init() Igor Mammedov
2013-04-25 14:05 ` [Qemu-devel] [PATCH 13/15] add hot_add_cpu hook to QEMUMachine and export machine_args Igor Mammedov
2013-04-25 14:05 ` [Qemu-devel] [PATCH 14/15] target-i386: implement machine->hot_add_cpu hook Igor Mammedov
2013-04-25 14:05 ` [Qemu-devel] [PATCH 15/15] QMP: add cpu-add command Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=517951CA.4080309@suse.de \
    --to=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=anthony.perard@citrix.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=stefano.stabellini@eu.citrix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.