All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35
@ 2014-01-09 16:36 Igor Mammedov
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 1/9] acpi: factor out common cpu hotplug code for PIIX4/Q35 Igor Mammedov
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Igor Mammedov @ 2014-01-09 16:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: mst, hutao, mjt, chen.fan.fnst, aliguori, anthony.perard, afaerber

Changes since v2:
  * use dependency auto generation for *.dsl files
  * hide DEVICE(PRES) from UI
  * add comments to document holes punched in CRES
  * reduce ifdeffenery by moving CPU hotplug defines to
    a dedicated header shared between C and ASL files
  * other odd changes requested by "Michael S. Tsirkin" <mst@redhat.com>
  
Changes since v1:
  * renamed hotplug.c/.h to  cpu_hotplug.c/.h
  * make all prefixes acpi_cpu_hotplug and AcpiCpuHotplug
  * updated docs/specs/acpi_cpu_hotplug.txt with Q35's IO port range
  * exclude CPU/PCI/GPE IO ranges from resources advertised
    in PCI bus _CRS
  * advertise CPU hotplug IO range using ACPI Device(ACPI0004)._CRS
    object.
  * change Q35 IO port ase from 0xa18 to 0xcd8, to avoid increasing
    fragmentation of PCI bus IO space
  * replaced runtime IO port setting with compile time one, since
    port mapping is hadcoded and there is not real need to set it
    dynamically.
  * Use the same headers for C and ASL code so that port/length
    values won't be duplicated.
  * Fix deps for ACPI tables, so that thay would be rebuild when
    included files are touched. (Added only includes, I've touched,
    it's not complete but a good start anyway)

Tested with RHEL6, WS2012R2, WS2003

Series is based on mst/pci tree, git tree for testing:
https://github.com/imammedo/qemu/commits/q35_cpu_hp_v3

Igor Mammedov (9):
  acpi: factor out common cpu hotplug code for PIIX4/Q35
  acpi: ich9: add CPU hotplug handling to Q35 machine
  pc: make: fix dependencies: rebuild when included file is changed
  pc: set PRST base in DSDT depending on chipset
  pc: PIIX DSDT: exclude CPU/PCI hotplug & GPE0 IO range from PCI bus
    resources
  pc: Q35 DSDT: exclude CPU hotplug IO range from PCI bus resources
  pc: ACPI: expose PRST IO range via _CRS
  pc: ACPI: unify source of CPU hotplug IO base/len
  pc: ACPI: update acpi-dsdt.hex.generated q35-acpi-dsdt.hex.generated

 docs/specs/acpi_cpu_hotplug.txt     |    4 +-
 hw/acpi/Makefile.objs               |    2 +-
 hw/acpi/cpu_hotplug.c               |   64 +++++++
 hw/acpi/ich9.c                      |   14 ++
 hw/acpi/piix4.c                     |   80 +--------
 hw/i386/Makefile.objs               |    2 +-
 hw/i386/acpi-dsdt-cpu-hotplug.dsl   |   14 ++-
 hw/i386/acpi-dsdt-pci-crs.dsl       |   15 +--
 hw/i386/acpi-dsdt.dsl               |   41 +++++
 hw/i386/acpi-dsdt.hex.generated     |  333 +++++++++++++++++++++++++++--------
 hw/i386/q35-acpi-dsdt.dsl           |   18 ++
 hw/i386/q35-acpi-dsdt.hex.generated |  138 ++++++++++++--
 include/hw/acpi/cpu_hotplug.h       |   27 +++
 include/hw/acpi/cpu_hotplug_defs.h  |   24 +++
 include/hw/acpi/ich9.h              |    4 +
 15 files changed, 592 insertions(+), 188 deletions(-)
 create mode 100644 hw/acpi/cpu_hotplug.c
 create mode 100644 include/hw/acpi/cpu_hotplug.h
 create mode 100644 include/hw/acpi/cpu_hotplug_defs.h

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 1/9] acpi: factor out common cpu hotplug code for PIIX4/Q35
  2014-01-09 16:36 [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Igor Mammedov
@ 2014-01-09 16:36 ` Igor Mammedov
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 2/9] acpi: ich9: add CPU hotplug handling to Q35 machine Igor Mammedov
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Igor Mammedov @ 2014-01-09 16:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: mst, hutao, mjt, chen.fan.fnst, aliguori, anthony.perard, afaerber

.. so it could be used for adding CPU hotplug to Q35 machine

Add an additional header with that will be shared between
C and ASL code: include/hw/acpi/cpu_hotplug_defs.h

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/acpi/Makefile.objs              |    2 +-
 hw/acpi/cpu_hotplug.c              |   64 ++++++++++++++++++++++++++++++
 hw/acpi/piix4.c                    |   77 +++---------------------------------
 include/hw/acpi/cpu_hotplug.h      |   27 ++++++++++++
 include/hw/acpi/cpu_hotplug_defs.h |   22 ++++++++++
 5 files changed, 120 insertions(+), 72 deletions(-)
 create mode 100644 hw/acpi/cpu_hotplug.c
 create mode 100644 include/hw/acpi/cpu_hotplug.h
 create mode 100644 include/hw/acpi/cpu_hotplug_defs.h

diff --git a/hw/acpi/Makefile.objs b/hw/acpi/Makefile.objs
index 841eca2..397d32b 100644
--- a/hw/acpi/Makefile.objs
+++ b/hw/acpi/Makefile.objs
@@ -1 +1 @@
-common-obj-$(CONFIG_ACPI) += core.o piix4.o ich9.o pcihp.o
+common-obj-$(CONFIG_ACPI) += core.o piix4.o ich9.o pcihp.o cpu_hotplug.o
diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
new file mode 100644
index 0000000..48928dc
--- /dev/null
+++ b/hw/acpi/cpu_hotplug.c
@@ -0,0 +1,64 @@
+/*
+ * QEMU ACPI hotplug utilities
+ *
+ * Copyright (C) 2013 Red Hat Inc
+ *
+ * Authors:
+ *   Igor Mammedov <imammedo@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#include "hw/hw.h"
+#include "hw/acpi/cpu_hotplug.h"
+
+static uint64_t cpu_status_read(void *opaque, hwaddr addr, unsigned int size)
+{
+    AcpiCpuHotplug *cpus = opaque;
+    uint64_t val = cpus->sts[addr];
+
+    return val;
+}
+
+static void cpu_status_write(void *opaque, hwaddr addr, uint64_t data,
+                             unsigned int size)
+{
+    /* TODO: implement VCPU removal on guest signal that CPU can be removed */
+}
+
+static const MemoryRegionOps AcpiCpuHotplug_ops = {
+    .read = cpu_status_read,
+    .write = cpu_status_write,
+    .endianness = DEVICE_LITTLE_ENDIAN,
+    .valid = {
+        .min_access_size = 1,
+        .max_access_size = 1,
+    },
+};
+
+void AcpiCpuHotplug_add(ACPIGPE *gpe, AcpiCpuHotplug *g, CPUState *cpu)
+{
+    CPUClass *k = CPU_GET_CLASS(cpu);
+    int64_t cpu_id;
+
+    *gpe->sts = *gpe->sts | ACPI_CPU_HOTPLUG_STATUS;
+    cpu_id = k->get_arch_id(CPU(cpu));
+    g->sts[cpu_id / 8] |= (1 << (cpu_id % 8));
+}
+
+void AcpiCpuHotplug_init(MemoryRegion *parent, Object *owner,
+                         AcpiCpuHotplug *gpe_cpu, uint16_t base)
+{
+    CPUState *cpu;
+
+    CPU_FOREACH(cpu) {
+        CPUClass *cc = CPU_GET_CLASS(cpu);
+        int64_t id = cc->get_arch_id(cpu);
+
+        g_assert((id / 8) < ACPI_GPE_PROC_LEN);
+        gpe_cpu->sts[id / 8] |= (1 << (id % 8));
+    }
+    memory_region_init_io(&gpe_cpu->io, owner, &AcpiCpuHotplug_ops,
+                          gpe_cpu, "acpi-cpu-hotplug", ACPI_GPE_PROC_LEN);
+    memory_region_add_subregion(parent, base, &gpe_cpu->io);
+}
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index c42eed1..9b7fe6b 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -31,6 +31,7 @@
 #include "exec/address-spaces.h"
 #include "hw/acpi/piix4.h"
 #include "hw/acpi/pcihp.h"
+#include "hw/acpi/cpu_hotplug.h"
 
 //#define DEBUG
 
@@ -51,20 +52,14 @@
 #define PCI_RMV_BASE 0xae0c
 
 #define PIIX4_PROC_BASE 0xaf00
-#define PIIX4_PROC_LEN 32
 
 #define PIIX4_PCI_HOTPLUG_STATUS 2
-#define PIIX4_CPU_HOTPLUG_STATUS 4
 
 struct pci_status {
     uint32_t up; /* deprecated, maintained for migration compatibility */
     uint32_t down;
 };
 
-typedef struct CPUStatus {
-    uint8_t sts[PIIX4_PROC_LEN];
-} CPUStatus;
-
 typedef struct PIIX4PMState {
     /*< private >*/
     PCIDevice parent_obj;
@@ -74,7 +69,6 @@ typedef struct PIIX4PMState {
     uint32_t io_base;
 
     MemoryRegion io_gpe;
-    MemoryRegion io_cpu;
     ACPIREGS ar;
 
     APMState apm;
@@ -102,7 +96,7 @@ typedef struct PIIX4PMState {
     uint8_t disable_s4;
     uint8_t s4_val;
 
-    CPUStatus gpe_cpu;
+    AcpiCpuHotplug gpe_cpu;
     Notifier cpu_added_notifier;
 } PIIX4PMState;
 
@@ -679,61 +673,13 @@ static const MemoryRegionOps piix4_pci_ops = {
     },
 };
 
-static uint64_t cpu_status_read(void *opaque, hwaddr addr, unsigned int size)
-{
-    PIIX4PMState *s = opaque;
-    CPUStatus *cpus = &s->gpe_cpu;
-    uint64_t val = cpus->sts[addr];
-
-    return val;
-}
-
-static void cpu_status_write(void *opaque, hwaddr addr, uint64_t data,
-                             unsigned int size)
-{
-    /* TODO: implement VCPU removal on guest signal that CPU can be removed */
-}
-
-static const MemoryRegionOps cpu_hotplug_ops = {
-    .read = cpu_status_read,
-    .write = cpu_status_write,
-    .endianness = DEVICE_LITTLE_ENDIAN,
-    .valid = {
-        .min_access_size = 1,
-        .max_access_size = 1,
-    },
-};
-
-typedef enum {
-    PLUG,
-    UNPLUG,
-} HotplugEventType;
-
-static void piix4_cpu_hotplug_req(PIIX4PMState *s, CPUState *cpu,
-                                  HotplugEventType action)
-{
-    CPUStatus *g = &s->gpe_cpu;
-    ACPIGPE *gpe = &s->ar.gpe;
-    CPUClass *k = CPU_GET_CLASS(cpu);
-    int64_t cpu_id;
-
-    assert(s != NULL);
-
-    *gpe->sts = *gpe->sts | PIIX4_CPU_HOTPLUG_STATUS;
-    cpu_id = k->get_arch_id(CPU(cpu));
-    if (action == PLUG) {
-        g->sts[cpu_id / 8] |= (1 << (cpu_id % 8));
-    } else {
-        g->sts[cpu_id / 8] &= ~(1 << (cpu_id % 8));
-    }
-    acpi_update_sci(&s->ar, s->irq);
-}
-
 static void piix4_cpu_added_req(Notifier *n, void *opaque)
 {
     PIIX4PMState *s = container_of(n, PIIX4PMState, cpu_added_notifier);
 
-    piix4_cpu_hotplug_req(s, CPU(opaque), PLUG);
+    assert(s != NULL);
+    AcpiCpuHotplug_add(&s->ar.gpe, &s->gpe_cpu, CPU(opaque));
+    acpi_update_sci(&s->ar, s->irq);
 }
 
 static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev,
@@ -742,8 +688,6 @@ static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev,
 static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
                                            PCIBus *bus, PIIX4PMState *s)
 {
-    CPUState *cpu;
-
     memory_region_init_io(&s->io_gpe, OBJECT(s), &piix4_gpe_ops, s,
                           "acpi-gpe0", GPE_LEN);
     memory_region_add_subregion(parent, GPE_BASE, &s->io_gpe);
@@ -758,16 +702,7 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
         pci_bus_hotplug(bus, piix4_device_hotplug, DEVICE(s));
     }
 
-    CPU_FOREACH(cpu) {
-        CPUClass *cc = CPU_GET_CLASS(cpu);
-        int64_t id = cc->get_arch_id(cpu);
-
-        g_assert((id / 8) < PIIX4_PROC_LEN);
-        s->gpe_cpu.sts[id / 8] |= (1 << (id % 8));
-    }
-    memory_region_init_io(&s->io_cpu, OBJECT(s), &cpu_hotplug_ops, s,
-                          "acpi-cpu-hotplug", PIIX4_PROC_LEN);
-    memory_region_add_subregion(parent, PIIX4_PROC_BASE, &s->io_cpu);
+    AcpiCpuHotplug_init(parent, OBJECT(s), &s->gpe_cpu, PIIX4_PROC_BASE);
     s->cpu_added_notifier.notify = piix4_cpu_added_req;
     qemu_register_cpu_added_notifier(&s->cpu_added_notifier);
 }
diff --git a/include/hw/acpi/cpu_hotplug.h b/include/hw/acpi/cpu_hotplug.h
new file mode 100644
index 0000000..4576400
--- /dev/null
+++ b/include/hw/acpi/cpu_hotplug.h
@@ -0,0 +1,27 @@
+/*
+ * QEMU ACPI hotplug utilities
+ *
+ * Copyright (C) 2013 Red Hat Inc
+ *
+ * Authors:
+ *   Igor Mammedov <imammedo@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef ACPI_HOTPLUG_H
+#define ACPI_HOTPLUG_H
+
+#include "hw/acpi/acpi.h"
+#include "hw/acpi/cpu_hotplug_defs.h"
+
+typedef struct AcpiCpuHotplug {
+    MemoryRegion io;
+    uint8_t sts[ACPI_GPE_PROC_LEN];
+} AcpiCpuHotplug;
+
+void AcpiCpuHotplug_add(ACPIGPE *gpe, AcpiCpuHotplug *g, CPUState *cpu);
+
+void AcpiCpuHotplug_init(MemoryRegion *parent, Object *owner,
+                         AcpiCpuHotplug *gpe_cpu, uint16_t base);
+#endif
diff --git a/include/hw/acpi/cpu_hotplug_defs.h b/include/hw/acpi/cpu_hotplug_defs.h
new file mode 100644
index 0000000..c6c4f78
--- /dev/null
+++ b/include/hw/acpi/cpu_hotplug_defs.h
@@ -0,0 +1,22 @@
+/*
+ * QEMU ACPI hotplug utilities shared defines
+ *
+ * Copyright (C) 2013 Red Hat Inc
+ *
+ * Authors:
+ *   Igor Mammedov <imammedo@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef ACPI_HOTPLUG_DEFS_H
+#define ACPI_HOTPLUG_DEFS_H
+
+/*
+ * ONLY DEFINEs are permited in this file since it's shared
+ * between C and ASL code.
+ */
+#define ACPI_CPU_HOTPLUG_STATUS 4
+#define ACPI_GPE_PROC_LEN 32
+
+#endif
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 2/9] acpi: ich9: add CPU hotplug handling to Q35 machine
  2014-01-09 16:36 [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Igor Mammedov
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 1/9] acpi: factor out common cpu hotplug code for PIIX4/Q35 Igor Mammedov
@ 2014-01-09 16:36 ` Igor Mammedov
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 3/9] pc: make: fix dependencies: rebuild when included file is changed Igor Mammedov
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Igor Mammedov @ 2014-01-09 16:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: mst, hutao, mjt, chen.fan.fnst, aliguori, anthony.perard, afaerber

.. use IO port 0cd8-0xcf7 range for CPU present bitmap

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 docs/specs/acpi_cpu_hotplug.txt    |    4 +++-
 hw/acpi/ich9.c                     |   14 ++++++++++++++
 include/hw/acpi/cpu_hotplug_defs.h |    1 +
 include/hw/acpi/ich9.h             |    4 ++++
 4 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/docs/specs/acpi_cpu_hotplug.txt b/docs/specs/acpi_cpu_hotplug.txt
index f6f5774..340b751 100644
--- a/docs/specs/acpi_cpu_hotplug.txt
+++ b/docs/specs/acpi_cpu_hotplug.txt
@@ -10,7 +10,9 @@ ACPI GPE block (IO ports 0xafe0-0xafe3, byte access):
 Generic ACPI GPE block. Bit 2 (GPE.2) used to notify CPU
 hot-add/remove event to ACPI BIOS, via SCI interrupt.
 
-CPU present bitmap (IO port 0xaf00-0xaf1f, 1-byte access):
+CPU present bitmap for:
+  ICH9-LPC (IO port 0x0cd8-0xcf7, 1-byte access)
+  PIIX-PM  (IO port 0xaf00-0xaf1f, 1-byte access)
 ---------------------------------------------------------------
 One bit per CPU. Bit position reflects corresponding CPU APIC ID.
 Read-only.
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 30f0df8..0afac42 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -185,6 +185,15 @@ static void pm_powerdown_req(Notifier *n, void *opaque)
     acpi_pm1_evt_power_down(&pm->acpi_regs);
 }
 
+static void ich9_cpu_added_req(Notifier *n, void *opaque)
+{
+    ICH9LPCPMRegs *pm = container_of(n, ICH9LPCPMRegs, cpu_added_notifier);
+
+    assert(pm != NULL);
+    AcpiCpuHotplug_add(&pm->acpi_regs.gpe, &pm->gpe_cpu, CPU(opaque));
+    acpi_update_sci(&pm->acpi_regs, pm->irq);
+}
+
 void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
                   qemu_irq sci_irq)
 {
@@ -210,6 +219,11 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
     qemu_register_reset(pm_reset, pm);
     pm->powerdown_notifier.notify = pm_powerdown_req;
     qemu_register_powerdown_notifier(&pm->powerdown_notifier);
+
+    AcpiCpuHotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci),
+                        &pm->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE);
+    pm->cpu_added_notifier.notify = ich9_cpu_added_req;
+    qemu_register_cpu_added_notifier(&pm->cpu_added_notifier);
 }
 
 static void ich9_pm_get_gpe0_blk(Object *obj, Visitor *v,
diff --git a/include/hw/acpi/cpu_hotplug_defs.h b/include/hw/acpi/cpu_hotplug_defs.h
index c6c4f78..47a35e3 100644
--- a/include/hw/acpi/cpu_hotplug_defs.h
+++ b/include/hw/acpi/cpu_hotplug_defs.h
@@ -18,5 +18,6 @@
  */
 #define ACPI_CPU_HOTPLUG_STATUS 4
 #define ACPI_GPE_PROC_LEN 32
+#define ICH9_CPU_HOTPLUG_IO_BASE 0x0CD8
 
 #endif
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index 82fcf9f..104f419 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -22,6 +22,7 @@
 #define HW_ACPI_ICH9_H
 
 #include "hw/acpi/acpi.h"
+#include "hw/acpi/cpu_hotplug.h"
 
 typedef struct ICH9LPCPMRegs {
     /*
@@ -42,6 +43,9 @@ typedef struct ICH9LPCPMRegs {
 
     uint32_t pm_io_base;
     Notifier powerdown_notifier;
+
+    AcpiCpuHotplug gpe_cpu;
+    Notifier cpu_added_notifier;
 } ICH9LPCPMRegs;
 
 void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 3/9] pc: make: fix dependencies: rebuild when included file is changed
  2014-01-09 16:36 [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Igor Mammedov
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 1/9] acpi: factor out common cpu hotplug code for PIIX4/Q35 Igor Mammedov
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 2/9] acpi: ich9: add CPU hotplug handling to Q35 machine Igor Mammedov
@ 2014-01-09 16:36 ` Igor Mammedov
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 4/9] pc: set PRST base in DSDT depending on chipset Igor Mammedov
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Igor Mammedov @ 2014-01-09 16:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: mst, hutao, mjt, chen.fan.fnst, aliguori, anthony.perard, afaerber

some *.dsl files include another *.dsl files but there weren't
any dependicies and when included file changed target table wasn't
rebuild. Fix this by using the same auto dependency generation
as for C files.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/i386/Makefile.objs |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 09ac433..d58a103 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -17,7 +17,7 @@ iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \
 ifdef IASL
 #IASL Present. Generate hex files from .dsl
 hw/i386/%.hex: $(SRC_PATH)/hw/i386/%.dsl $(SRC_PATH)/scripts/acpi_extract_preprocess.py $(SRC_PATH)/scripts/acpi_extract.py
-	$(call quiet-command, cpp -P $< -o $*.dsl.i.orig, "  CPP $(TARGET_DIR)$*.dsl.i.orig")
+	$(call quiet-command, cpp -P $(QEMU_DGFLAGS) $< -o $*.dsl.i.orig, "  CPP $(TARGET_DIR)$*.dsl.i.orig")
 	$(call quiet-command, $(PYTHON) $(SRC_PATH)/scripts/acpi_extract_preprocess.py $*.dsl.i.orig > $*.dsl.i, "  ACPI_PREPROCESS $(TARGET_DIR)$*.dsl.i")
 	$(call quiet-command, $(IASL) $(call iasl-option,$(IASL),-Pn,) -vs -l -tc -p $* $*.dsl.i $(if $(V), , > /dev/null) 2>&1 ,"  IASL $(TARGET_DIR)$*.dsl.i")
 	$(call quiet-command, $(PYTHON) $(SRC_PATH)/scripts/acpi_extract.py $*.lst > $*.off, "  ACPI_EXTRACT $(TARGET_DIR)$*.off")
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 4/9] pc: set PRST base in DSDT depending on chipset
  2014-01-09 16:36 [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Igor Mammedov
                   ` (2 preceding siblings ...)
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 3/9] pc: make: fix dependencies: rebuild when included file is changed Igor Mammedov
@ 2014-01-09 16:36 ` Igor Mammedov
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 5/9] pc: PIIX DSDT: exclude CPU/PCI hotplug & GPE0 IO range from PCI bus resources Igor Mammedov
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Igor Mammedov @ 2014-01-09 16:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: mst, hutao, mjt, chen.fan.fnst, aliguori, anthony.perard, afaerber

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/i386/acpi-dsdt-cpu-hotplug.dsl |    2 +-
 hw/i386/acpi-dsdt.dsl             |    1 +
 hw/i386/q35-acpi-dsdt.dsl         |    1 +
 3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/hw/i386/acpi-dsdt-cpu-hotplug.dsl b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
index 995b415..1dfbb4f 100644
--- a/hw/i386/acpi-dsdt-cpu-hotplug.dsl
+++ b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
@@ -52,7 +52,7 @@ Scope(\_SB) {
         Sleep(200)
     }
 
-    OperationRegion(PRST, SystemIO, 0xaf00, 32)
+    OperationRegion(PRST, SystemIO, CPU_STATUS_BASE, 32)
     Field(PRST, ByteAcc, NoLock, Preserve) {
         PRS, 256
     }
diff --git a/hw/i386/acpi-dsdt.dsl b/hw/i386/acpi-dsdt.dsl
index 6d76f30..3dc4789 100644
--- a/hw/i386/acpi-dsdt.dsl
+++ b/hw/i386/acpi-dsdt.dsl
@@ -290,6 +290,7 @@ DefinitionBlock (
         }
     }
 
+#define CPU_STATUS_BASE 0xaf00
 #include "acpi-dsdt-cpu-hotplug.dsl"
 
 
diff --git a/hw/i386/q35-acpi-dsdt.dsl b/hw/i386/q35-acpi-dsdt.dsl
index ee38fd6..9a43947 100644
--- a/hw/i386/q35-acpi-dsdt.dsl
+++ b/hw/i386/q35-acpi-dsdt.dsl
@@ -405,6 +405,7 @@ DefinitionBlock (
         define_gsi_link(GSIH, 0, 0x17)
     }
 
+#define CPU_STATUS_BASE 0x0CD8
 #include "acpi-dsdt-cpu-hotplug.dsl"
 
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 5/9] pc: PIIX DSDT: exclude CPU/PCI hotplug & GPE0 IO range from PCI bus resources
  2014-01-09 16:36 [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Igor Mammedov
                   ` (3 preceding siblings ...)
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 4/9] pc: set PRST base in DSDT depending on chipset Igor Mammedov
@ 2014-01-09 16:36 ` Igor Mammedov
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 6/9] pc: Q35 DSDT: exclude CPU hotplug " Igor Mammedov
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Igor Mammedov @ 2014-01-09 16:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: mst, hutao, mjt, chen.fan.fnst, aliguori, anthony.perard, afaerber

.. so that they might not be used by PCI devices.

Note:
Resort to concatenating templates with preprocessor help,
because 1.0b spec isn't supporting ConcatenateResTemplate,
as result Windows XP fails to execute PCI0._CRS method if
ConcatenateResTemplate() is used.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
Follow up patch will expose them as motherboard resources

v2:
 * add comments about holes origins for PCI/CPU hotplug and GPE0
---
 hw/i386/acpi-dsdt-pci-crs.dsl |    8 +-------
 hw/i386/acpi-dsdt.dsl         |   32 ++++++++++++++++++++++++++++++++
 hw/i386/q35-acpi-dsdt.dsl     |    8 ++++++++
 3 files changed, 41 insertions(+), 7 deletions(-)

diff --git a/hw/i386/acpi-dsdt-pci-crs.dsl b/hw/i386/acpi-dsdt-pci-crs.dsl
index b375a19..8b631d1 100644
--- a/hw/i386/acpi-dsdt-pci-crs.dsl
+++ b/hw/i386/acpi-dsdt-pci-crs.dsl
@@ -37,13 +37,7 @@ Scope(\_SB.PCI0) {
             0x0000,             // Address Translation Offset
             0x0CF8,             // Address Length
             ,, , TypeStatic)
-        WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
-            0x0000,             // Address Space Granularity
-            0x0D00,             // Address Range Minimum
-            0xFFFF,             // Address Range Maximum
-            0x0000,             // Address Translation Offset
-            0xF300,             // Address Length
-            ,, , TypeStatic)
+        BOARD_SPECIFIC_PCI_RESOURSES
         DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
             0x00000000,         // Address Space Granularity
             0x000A0000,         // Address Range Minimum
diff --git a/hw/i386/acpi-dsdt.dsl b/hw/i386/acpi-dsdt.dsl
index 3dc4789..f501c8d 100644
--- a/hw/i386/acpi-dsdt.dsl
+++ b/hw/i386/acpi-dsdt.dsl
@@ -35,6 +35,38 @@ DefinitionBlock (
 /****************************************************************
  * PCI Bus definition
  ****************************************************************/
+#define BOARD_SPECIFIC_PCI_RESOURSES \
+     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
+         0x0000, \
+         0x0D00, \
+         0xADFF, \
+         0x0000, \
+         0xA100, \
+         ,, , TypeStatic) \
+     /* 0xae00-0xae0e hole for PCI hotplug, hw/acpi/piix4.c:PCI_HOTPLUG_ADDR */ \
+     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
+         0x0000, \
+         0xAE0F, \
+         0xAEFF, \
+         0x0000, \
+         0x00F1, \
+         ,, , TypeStatic) \
+     /* 0xaf00-0xaf1f hole for CPU hotplug, hw/acpi/piix4.c:PIIX4_PROC_BASE */ \
+     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
+         0x0000, \
+         0xAF20, \
+         0xAFDF, \
+         0x0000, \
+         0x00C0, \
+         ,, , TypeStatic) \
+     /* 0xafe0-0xafe3 hole for ACPI.GPE0, hw/acpi/piix4.c:GPE_BASE */ \
+     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
+         0x0000, \
+         0xAFE4, \
+         0xFFFF, \
+         0x0000, \
+         0x501C, \
+         ,, , TypeStatic)
 
     Scope(\_SB) {
         Device(PCI0) {
diff --git a/hw/i386/q35-acpi-dsdt.dsl b/hw/i386/q35-acpi-dsdt.dsl
index 9a43947..f3e5921 100644
--- a/hw/i386/q35-acpi-dsdt.dsl
+++ b/hw/i386/q35-acpi-dsdt.dsl
@@ -48,6 +48,14 @@ DefinitionBlock (
 /****************************************************************
  * PCI Bus definition
  ****************************************************************/
+#define BOARD_SPECIFIC_PCI_RESOURSES \
+     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
+         0x0000, \
+         0x0D00, \
+         0xFFFF, \
+         0x0000, \
+         0xF300, \
+         ,, , TypeStatic)
 
     Scope(\_SB) {
         Device(PCI0) {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 6/9] pc: Q35 DSDT: exclude CPU hotplug IO range from PCI bus resources
  2014-01-09 16:36 [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Igor Mammedov
                   ` (4 preceding siblings ...)
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 5/9] pc: PIIX DSDT: exclude CPU/PCI hotplug & GPE0 IO range from PCI bus resources Igor Mammedov
@ 2014-01-09 16:36 ` Igor Mammedov
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 7/9] pc: ACPI: expose PRST IO range via _CRS Igor Mammedov
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Igor Mammedov @ 2014-01-09 16:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: mst, hutao, mjt, chen.fan.fnst, aliguori, anthony.perard, afaerber

... for range defined at hw/acpi/ich9.c:ICH9_PROC_BASE

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
 * add comment about hole origin for CPU hotplug
---
 hw/i386/acpi-dsdt-pci-crs.dsl |    7 -------
 hw/i386/acpi-dsdt.dsl         |    7 +++++++
 hw/i386/q35-acpi-dsdt.dsl     |    8 ++++++++
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/hw/i386/acpi-dsdt-pci-crs.dsl b/hw/i386/acpi-dsdt-pci-crs.dsl
index 8b631d1..4648e90 100644
--- a/hw/i386/acpi-dsdt-pci-crs.dsl
+++ b/hw/i386/acpi-dsdt-pci-crs.dsl
@@ -30,13 +30,6 @@ Scope(\_SB.PCI0) {
             0x01,               // Address Alignment
             0x08,               // Address Length
             )
-        WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
-            0x0000,             // Address Space Granularity
-            0x0000,             // Address Range Minimum
-            0x0CF7,             // Address Range Maximum
-            0x0000,             // Address Translation Offset
-            0x0CF8,             // Address Length
-            ,, , TypeStatic)
         BOARD_SPECIFIC_PCI_RESOURSES
         DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
             0x00000000,         // Address Space Granularity
diff --git a/hw/i386/acpi-dsdt.dsl b/hw/i386/acpi-dsdt.dsl
index f501c8d..d89dcda 100644
--- a/hw/i386/acpi-dsdt.dsl
+++ b/hw/i386/acpi-dsdt.dsl
@@ -38,6 +38,13 @@ DefinitionBlock (
 #define BOARD_SPECIFIC_PCI_RESOURSES \
      WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
          0x0000, \
+         0x0000, \
+         0x0CF7, \
+         0x0000, \
+         0x0CF8, \
+         ,, , TypeStatic) \
+     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
+         0x0000, \
          0x0D00, \
          0xADFF, \
          0x0000, \
diff --git a/hw/i386/q35-acpi-dsdt.dsl b/hw/i386/q35-acpi-dsdt.dsl
index f3e5921..9e070ee 100644
--- a/hw/i386/q35-acpi-dsdt.dsl
+++ b/hw/i386/q35-acpi-dsdt.dsl
@@ -51,6 +51,14 @@ DefinitionBlock (
 #define BOARD_SPECIFIC_PCI_RESOURSES \
      WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
          0x0000, \
+         0x0000, \
+         0x0CD7, \
+         0x0000, \
+         0x0CD8, \
+         ,, , TypeStatic) \
+     /* 0xcd8-0xcf7 hole for CPU hotplug, hw/acpi/ich9.c:ICH9_PROC_BASE */ \
+     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
+         0x0000, \
          0x0D00, \
          0xFFFF, \
          0x0000, \
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 7/9] pc: ACPI: expose PRST IO range via _CRS
  2014-01-09 16:36 [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Igor Mammedov
                   ` (5 preceding siblings ...)
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 6/9] pc: Q35 DSDT: exclude CPU hotplug " Igor Mammedov
@ 2014-01-09 16:36 ` Igor Mammedov
  2014-02-02 13:12   ` Michael S. Tsirkin
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 8/9] pc: ACPI: unify source of CPU hotplug IO base/len Igor Mammedov
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 13+ messages in thread
From: Igor Mammedov @ 2014-01-09 16:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: mst, hutao, mjt, chen.fan.fnst, aliguori, anthony.perard, afaerber

.. so OSPM could notice resource conflict if there is any.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
  * use define for DEVICE name to make it more descriptive
  * define _STA as present,functioning, decoding, not shown in UI
---
 hw/i386/acpi-dsdt-cpu-hotplug.dsl |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/hw/i386/acpi-dsdt-cpu-hotplug.dsl b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
index 1dfbb4f..f91eafd 100644
--- a/hw/i386/acpi-dsdt-cpu-hotplug.dsl
+++ b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
@@ -16,6 +16,7 @@
 /****************************************************************
  * CPU hotplug
  ****************************************************************/
+#define CPU_HOTPLUG_RESOURCE_DEVICE PRES
 
 Scope(\_SB) {
     /* Objects filled in by run-time generated SSDT */
@@ -52,7 +53,8 @@ Scope(\_SB) {
         Sleep(200)
     }
 
-    OperationRegion(PRST, SystemIO, CPU_STATUS_BASE, 32)
+#define CPU_STATUS_LEN 32
+    OperationRegion(PRST, SystemIO, CPU_STATUS_BASE, CPU_STATUS_LEN)
     Field(PRST, ByteAcc, NoLock, Preserve) {
         PRS, 256
     }
@@ -89,4 +91,14 @@ Scope(\_SB) {
             Increment(Local0)
         }
     }
+
+    Device(CPU_HOTPLUG_RESOURCE_DEVICE) {
+        Name(_HID, "ACPI0004")
+
+        Name(_CRS, ResourceTemplate() {
+            IO(Decode16, CPU_STATUS_BASE, CPU_STATUS_BASE, 0, CPU_STATUS_LEN)
+        })
+
+        Name(_STA, 0xB) /* present, functioning, decoding, not shown in UI */
+    }
 }
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 8/9] pc: ACPI: unify source of CPU hotplug IO base/len
  2014-01-09 16:36 [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Igor Mammedov
                   ` (6 preceding siblings ...)
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 7/9] pc: ACPI: expose PRST IO range via _CRS Igor Mammedov
@ 2014-01-09 16:36 ` Igor Mammedov
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 9/9] pc: ACPI: update acpi-dsdt.hex.generated q35-acpi-dsdt.hex.generated Igor Mammedov
  2014-01-16 10:35 ` [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Michael S. Tsirkin
  9 siblings, 0 replies; 13+ messages in thread
From: Igor Mammedov @ 2014-01-09 16:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: mst, hutao, mjt, chen.fan.fnst, aliguori, anthony.perard, afaerber

use C headers defines as source of IO base/len for respective
values in ASL code.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
 * add cpu_hotplug_defs.h for sharing defines to reduce ifdeffenery
---
 hw/acpi/piix4.c                    |    5 ++---
 hw/i386/Makefile.objs              |    2 +-
 hw/i386/acpi-dsdt-cpu-hotplug.dsl  |    2 +-
 hw/i386/acpi-dsdt.dsl              |    3 ++-
 hw/i386/q35-acpi-dsdt.dsl          |    3 ++-
 include/hw/acpi/cpu_hotplug_defs.h |    1 +
 6 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 9b7fe6b..4161d06 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -51,8 +51,6 @@
 #define PCI_EJ_BASE 0xae08
 #define PCI_RMV_BASE 0xae0c
 
-#define PIIX4_PROC_BASE 0xaf00
-
 #define PIIX4_PCI_HOTPLUG_STATUS 2
 
 struct pci_status {
@@ -702,7 +700,8 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
         pci_bus_hotplug(bus, piix4_device_hotplug, DEVICE(s));
     }
 
-    AcpiCpuHotplug_init(parent, OBJECT(s), &s->gpe_cpu, PIIX4_PROC_BASE);
+    AcpiCpuHotplug_init(parent, OBJECT(s), &s->gpe_cpu,
+                        PIIX4_CPU_HOTPLUG_IO_BASE);
     s->cpu_added_notifier.notify = piix4_cpu_added_req;
     qemu_register_cpu_added_notifier(&s->cpu_added_notifier);
 }
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index d58a103..3df1612 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -17,7 +17,7 @@ iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \
 ifdef IASL
 #IASL Present. Generate hex files from .dsl
 hw/i386/%.hex: $(SRC_PATH)/hw/i386/%.dsl $(SRC_PATH)/scripts/acpi_extract_preprocess.py $(SRC_PATH)/scripts/acpi_extract.py
-	$(call quiet-command, cpp -P $(QEMU_DGFLAGS) $< -o $*.dsl.i.orig, "  CPP $(TARGET_DIR)$*.dsl.i.orig")
+	$(call quiet-command, cpp -P $(QEMU_DGFLAGS) $(QEMU_INCLUDES) $< -o $*.dsl.i.orig, "  CPP $(TARGET_DIR)$*.dsl.i.orig")
 	$(call quiet-command, $(PYTHON) $(SRC_PATH)/scripts/acpi_extract_preprocess.py $*.dsl.i.orig > $*.dsl.i, "  ACPI_PREPROCESS $(TARGET_DIR)$*.dsl.i")
 	$(call quiet-command, $(IASL) $(call iasl-option,$(IASL),-Pn,) -vs -l -tc -p $* $*.dsl.i $(if $(V), , > /dev/null) 2>&1 ,"  IASL $(TARGET_DIR)$*.dsl.i")
 	$(call quiet-command, $(PYTHON) $(SRC_PATH)/scripts/acpi_extract.py $*.lst > $*.off, "  ACPI_EXTRACT $(TARGET_DIR)$*.off")
diff --git a/hw/i386/acpi-dsdt-cpu-hotplug.dsl b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
index f91eafd..dee4843 100644
--- a/hw/i386/acpi-dsdt-cpu-hotplug.dsl
+++ b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
@@ -53,7 +53,7 @@ Scope(\_SB) {
         Sleep(200)
     }
 
-#define CPU_STATUS_LEN 32
+#define CPU_STATUS_LEN ACPI_GPE_PROC_LEN
     OperationRegion(PRST, SystemIO, CPU_STATUS_BASE, CPU_STATUS_LEN)
     Field(PRST, ByteAcc, NoLock, Preserve) {
         PRS, 256
diff --git a/hw/i386/acpi-dsdt.dsl b/hw/i386/acpi-dsdt.dsl
index d89dcda..b23d5e0 100644
--- a/hw/i386/acpi-dsdt.dsl
+++ b/hw/i386/acpi-dsdt.dsl
@@ -329,7 +329,8 @@ DefinitionBlock (
         }
     }
 
-#define CPU_STATUS_BASE 0xaf00
+#include "hw/acpi/cpu_hotplug_defs.h"
+#define CPU_STATUS_BASE PIIX4_CPU_HOTPLUG_IO_BASE
 #include "acpi-dsdt-cpu-hotplug.dsl"
 
 
diff --git a/hw/i386/q35-acpi-dsdt.dsl b/hw/i386/q35-acpi-dsdt.dsl
index 9e070ee..d618e9e 100644
--- a/hw/i386/q35-acpi-dsdt.dsl
+++ b/hw/i386/q35-acpi-dsdt.dsl
@@ -421,7 +421,8 @@ DefinitionBlock (
         define_gsi_link(GSIH, 0, 0x17)
     }
 
-#define CPU_STATUS_BASE 0x0CD8
+#include "hw/acpi/cpu_hotplug_defs.h"
+#define CPU_STATUS_BASE ICH9_CPU_HOTPLUG_IO_BASE
 #include "acpi-dsdt-cpu-hotplug.dsl"
 
 
diff --git a/include/hw/acpi/cpu_hotplug_defs.h b/include/hw/acpi/cpu_hotplug_defs.h
index 47a35e3..2725b50 100644
--- a/include/hw/acpi/cpu_hotplug_defs.h
+++ b/include/hw/acpi/cpu_hotplug_defs.h
@@ -19,5 +19,6 @@
 #define ACPI_CPU_HOTPLUG_STATUS 4
 #define ACPI_GPE_PROC_LEN 32
 #define ICH9_CPU_HOTPLUG_IO_BASE 0x0CD8
+#define PIIX4_CPU_HOTPLUG_IO_BASE 0xaf00
 
 #endif
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 9/9] pc: ACPI: update acpi-dsdt.hex.generated q35-acpi-dsdt.hex.generated
  2014-01-09 16:36 [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Igor Mammedov
                   ` (7 preceding siblings ...)
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 8/9] pc: ACPI: unify source of CPU hotplug IO base/len Igor Mammedov
@ 2014-01-09 16:36 ` Igor Mammedov
  2014-01-16 10:35 ` [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Michael S. Tsirkin
  9 siblings, 0 replies; 13+ messages in thread
From: Igor Mammedov @ 2014-01-09 16:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: mst, hutao, mjt, chen.fan.fnst, aliguori, anthony.perard, afaerber

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/i386/acpi-dsdt.hex.generated     |  333 +++++++++++++++++++++++++++--------
 hw/i386/q35-acpi-dsdt.hex.generated |  138 ++++++++++++--
 2 files changed, 374 insertions(+), 97 deletions(-)

diff --git a/hw/i386/acpi-dsdt.hex.generated b/hw/i386/acpi-dsdt.hex.generated
index f8bd4ea..63b7e85 100644
--- a/hw/i386/acpi-dsdt.hex.generated
+++ b/hw/i386/acpi-dsdt.hex.generated
@@ -3,12 +3,12 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x53,
 0x44,
 0x54,
-0x37,
+0xe7,
 0x11,
 0x0,
 0x0,
 0x1,
-0xd8,
+0x4d,
 0x42,
 0x58,
 0x50,
@@ -32,8 +32,8 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x54,
 0x4c,
 0x23,
-0x8,
-0x13,
+0x1,
+0x9,
 0x20,
 0x10,
 0x49,
@@ -146,7 +146,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x1,
 0x10,
 0x4e,
-0x15,
+0x18,
 0x2e,
 0x5f,
 0x53,
@@ -163,9 +163,9 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x53,
 0x11,
 0x42,
-0x7,
 0xa,
-0x6e,
+0xa,
+0x9e,
 0x88,
 0xd,
 0x0,
@@ -217,11 +217,59 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x0,
 0xd,
 0xff,
+0xad,
+0x0,
+0x0,
+0x0,
+0xa1,
+0x88,
+0xd,
+0x0,
+0x1,
+0xc,
+0x3,
+0x0,
+0x0,
+0xf,
+0xae,
 0xff,
+0xae,
+0x0,
+0x0,
+0xf1,
+0x0,
+0x88,
+0xd,
+0x0,
+0x1,
+0xc,
+0x3,
+0x0,
+0x0,
+0x20,
+0xaf,
+0xdf,
+0xaf,
+0x0,
 0x0,
+0xc0,
+0x0,
+0x88,
+0xd,
+0x0,
+0x1,
+0xc,
+0x3,
+0x0,
+0x0,
+0xe4,
+0xaf,
+0xff,
+0xff,
 0x0,
 0x0,
-0xf3,
+0x1c,
+0x50,
 0x87,
 0x17,
 0x0,
@@ -347,7 +395,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x45,
 0x53,
 0xa,
-0x5c,
+0x8c,
 0x50,
 0x53,
 0x33,
@@ -358,7 +406,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x45,
 0x53,
 0xa,
-0x60,
+0x90,
 0x50,
 0x45,
 0x33,
@@ -369,7 +417,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x45,
 0x53,
 0xa,
-0x68,
+0x98,
 0x50,
 0x4c,
 0x33,
@@ -860,8 +908,8 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x4e,
 0x1,
 0x10,
-0x4c,
-0x1b,
+0x4b,
+0x1e,
 0x2f,
 0x3,
 0x5f,
@@ -879,6 +927,53 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x5b,
 0x82,
 0x2d,
+0x53,
+0x4d,
+0x43,
+0x5f,
+0x8,
+0x5f,
+0x48,
+0x49,
+0x44,
+0xc,
+0x6,
+0x10,
+0x0,
+0x1,
+0x8,
+0x5f,
+0x53,
+0x54,
+0x41,
+0xb,
+0x0,
+0xff,
+0x8,
+0x5f,
+0x43,
+0x52,
+0x53,
+0x11,
+0x10,
+0xa,
+0xd,
+0x47,
+0x1,
+0x0,
+0x3,
+0x0,
+0x3,
+0x1,
+0x20,
+0x22,
+0x40,
+0x0,
+0x79,
+0x0,
+0x5b,
+0x82,
+0x2d,
 0x52,
 0x54,
 0x43,
@@ -1305,7 +1400,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x79,
 0x0,
 0x10,
-0x4b,
+0x48,
 0x8,
 0x2e,
 0x5f,
@@ -1371,79 +1466,76 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x45,
 0x4a,
 0x20,
+0x5b,
+0x80,
+0x42,
+0x4e,
+0x4d,
+0x52,
+0x1,
+0xb,
+0x10,
+0xae,
+0xa,
+0x4,
+0x5b,
+0x81,
+0xb,
+0x42,
+0x4e,
+0x4d,
+0x52,
+0x43,
+0x42,
+0x4e,
+0x55,
+0x4d,
+0x20,
+0x5b,
+0x1,
+0x42,
+0x4c,
+0x43,
+0x4b,
+0x0,
 0x14,
-0x11,
+0x25,
 0x50,
 0x43,
 0x45,
 0x4a,
-0x1,
+0x2,
+0x5b,
+0x23,
+0x42,
+0x4c,
+0x43,
+0x4b,
+0xff,
+0xff,
 0x70,
-0x79,
-0x1,
 0x68,
-0x0,
 0x42,
-0x30,
-0x45,
-0x4a,
-0xa4,
-0x0,
-0x14,
-0x36,
-0x50,
-0x43,
 0x4e,
-0x46,
-0x0,
-0x70,
-0x0,
-0x60,
-0xa2,
-0x2c,
-0x95,
-0x60,
-0xa,
-0x1f,
-0x75,
-0x60,
-0xa0,
-0x11,
-0x7b,
-0x50,
-0x43,
-0x49,
 0x55,
+0x4d,
+0x70,
 0x79,
 0x1,
-0x60,
+0x69,
 0x0,
-0x0,
-0x50,
-0x43,
-0x4e,
-0x54,
-0x60,
-0x1,
-0xa0,
-0x12,
-0x7b,
-0x50,
+0x42,
+0x30,
+0x45,
+0x4a,
+0x5b,
+0x27,
+0x42,
+0x4c,
 0x43,
-0x49,
-0x44,
-0x79,
-0x1,
-0x60,
-0x0,
+0x4b,
+0xa4,
 0x0,
-0x50,
-0x43,
-0x4e,
-0x54,
-0x60,
-0xa,
-0x3,
 0x10,
 0x4a,
 0xa0,
@@ -4017,7 +4109,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x1,
 0x10,
 0x47,
-0xe,
+0x11,
 0x5f,
 0x53,
 0x42,
@@ -4247,9 +4339,57 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x3,
 0x75,
 0x60,
+0x5b,
+0x82,
+0x2e,
+0x50,
+0x52,
+0x45,
+0x53,
+0x8,
+0x5f,
+0x48,
+0x49,
+0x44,
+0xd,
+0x41,
+0x43,
+0x50,
+0x49,
+0x30,
+0x30,
+0x30,
+0x34,
+0x0,
+0x8,
+0x5f,
+0x43,
+0x52,
+0x53,
+0x11,
+0xd,
+0xa,
+0xa,
+0x47,
+0x1,
+0x0,
+0xaf,
+0x0,
+0xaf,
+0x0,
+0x20,
+0x79,
+0x0,
+0x8,
+0x5f,
+0x53,
+0x54,
+0x41,
+0xa,
+0xb,
 0x10,
-0x4e,
-0x9,
+0x42,
+0xc,
 0x5f,
 0x47,
 0x50,
@@ -4277,12 +4417,31 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x30,
 0x0,
 0x14,
-0x15,
+0x39,
 0x5f,
 0x45,
 0x30,
 0x31,
 0x0,
+0x5b,
+0x23,
+0x5c,
+0x2f,
+0x3,
+0x5f,
+0x53,
+0x42,
+0x5f,
+0x50,
+0x43,
+0x49,
+0x30,
+0x42,
+0x4c,
+0x43,
+0x4b,
+0xff,
+0xff,
 0x5c,
 0x2f,
 0x3,
@@ -4297,7 +4456,24 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x50,
 0x43,
 0x4e,
-0x46,
+0x54,
+0x5b,
+0x27,
+0x5c,
+0x2f,
+0x3,
+0x5f,
+0x53,
+0x42,
+0x5f,
+0x50,
+0x43,
+0x49,
+0x30,
+0x42,
+0x4c,
+0x43,
+0x4b,
 0x14,
 0x10,
 0x5f,
@@ -4407,3 +4583,6 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x46,
 0x0
 };
+static unsigned short piix_dsdt_applesmc_sta[] = {
+0x3b4
+};
diff --git a/hw/i386/q35-acpi-dsdt.hex.generated b/hw/i386/q35-acpi-dsdt.hex.generated
index 111ad3e..2e67566 100644
--- a/hw/i386/q35-acpi-dsdt.hex.generated
+++ b/hw/i386/q35-acpi-dsdt.hex.generated
@@ -3,12 +3,12 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x53,
 0x44,
 0x54,
-0xb0,
-0x1c,
+0xf,
+0x1d,
 0x0,
 0x0,
 0x1,
-0xfe,
+0xea,
 0x42,
 0x58,
 0x50,
@@ -32,8 +32,8 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x54,
 0x4c,
 0x23,
-0x8,
-0x13,
+0x1,
+0x9,
 0x20,
 0x10,
 0x49,
@@ -415,11 +415,11 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x0,
 0x0,
 0x0,
-0xf7,
+0xd7,
 0xc,
 0x0,
 0x0,
-0xf8,
+0xd8,
 0xc,
 0x88,
 0xd,
@@ -1033,8 +1033,8 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x4e,
 0x1,
 0x10,
-0x4c,
-0x1b,
+0x4b,
+0x1e,
 0x2f,
 0x3,
 0x5f,
@@ -1052,6 +1052,53 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x5b,
 0x82,
 0x2d,
+0x53,
+0x4d,
+0x43,
+0x5f,
+0x8,
+0x5f,
+0x48,
+0x49,
+0x44,
+0xc,
+0x6,
+0x10,
+0x0,
+0x1,
+0x8,
+0x5f,
+0x53,
+0x54,
+0x41,
+0xb,
+0x0,
+0xff,
+0x8,
+0x5f,
+0x43,
+0x52,
+0x53,
+0x11,
+0x10,
+0xa,
+0xd,
+0x47,
+0x1,
+0x0,
+0x3,
+0x0,
+0x3,
+0x1,
+0x20,
+0x22,
+0x40,
+0x0,
+0x79,
+0x0,
+0x5b,
+0x82,
+0x2d,
 0x52,
 0x54,
 0x43,
@@ -6969,7 +7016,7 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x1,
 0x10,
 0x47,
-0xe,
+0x11,
 0x5f,
 0x53,
 0x42,
@@ -7074,8 +7121,8 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x54,
 0x1,
 0xb,
-0x0,
-0xaf,
+0xd8,
+0xc,
 0xa,
 0x20,
 0x5b,
@@ -7199,6 +7246,54 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x3,
 0x75,
 0x60,
+0x5b,
+0x82,
+0x2e,
+0x50,
+0x52,
+0x45,
+0x53,
+0x8,
+0x5f,
+0x48,
+0x49,
+0x44,
+0xd,
+0x41,
+0x43,
+0x50,
+0x49,
+0x30,
+0x30,
+0x30,
+0x34,
+0x0,
+0x8,
+0x5f,
+0x43,
+0x52,
+0x53,
+0x11,
+0xd,
+0xa,
+0xa,
+0x47,
+0x1,
+0xd8,
+0xc,
+0xd8,
+0xc,
+0x0,
+0x20,
+0x79,
+0x0,
+0x8,
+0x5f,
+0x53,
+0x54,
+0x41,
+0xa,
+0xb,
 0x10,
 0x4f,
 0x8,
@@ -7229,12 +7324,19 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x30,
 0x0,
 0x14,
-0x10,
+0x6,
 0x5f,
 0x4c,
 0x30,
 0x31,
 0x0,
+0x14,
+0x10,
+0x5f,
+0x45,
+0x30,
+0x32,
+0x0,
 0x5c,
 0x2e,
 0x5f,
@@ -7250,13 +7352,6 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x5f,
 0x4c,
 0x30,
-0x32,
-0x0,
-0x14,
-0x6,
-0x5f,
-0x4c,
-0x30,
 0x33,
 0x0,
 0x14,
@@ -7344,3 +7439,6 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x46,
 0x0
 };
+static unsigned short q35_dsdt_applesmc_sta[] = {
+0x431
+};
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35
  2014-01-09 16:36 [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Igor Mammedov
                   ` (8 preceding siblings ...)
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 9/9] pc: ACPI: update acpi-dsdt.hex.generated q35-acpi-dsdt.hex.generated Igor Mammedov
@ 2014-01-16 10:35 ` Michael S. Tsirkin
  9 siblings, 0 replies; 13+ messages in thread
From: Michael S. Tsirkin @ 2014-01-16 10:35 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: hutao, mjt, qemu-devel, chen.fan.fnst, aliguori, anthony.perard,
	afaerber

On Thu, Jan 09, 2014 at 05:36:30PM +0100, Igor Mammedov wrote:
> Changes since v2:
>   * use dependency auto generation for *.dsl files
>   * hide DEVICE(PRES) from UI
>   * add comments to document holes punched in CRES
>   * reduce ifdeffenery by moving CPU hotplug defines to
>     a dedicated header shared between C and ASL files
>   * other odd changes requested by "Michael S. Tsirkin" <mst@redhat.com>
>   
> Changes since v1:
>   * renamed hotplug.c/.h to  cpu_hotplug.c/.h
>   * make all prefixes acpi_cpu_hotplug and AcpiCpuHotplug
>   * updated docs/specs/acpi_cpu_hotplug.txt with Q35's IO port range
>   * exclude CPU/PCI/GPE IO ranges from resources advertised
>     in PCI bus _CRS
>   * advertise CPU hotplug IO range using ACPI Device(ACPI0004)._CRS
>     object.
>   * change Q35 IO port ase from 0xa18 to 0xcd8, to avoid increasing
>     fragmentation of PCI bus IO space
>   * replaced runtime IO port setting with compile time one, since
>     port mapping is hadcoded and there is not real need to set it
>     dynamically.
>   * Use the same headers for C and ASL code so that port/length
>     values won't be duplicated.
>   * Fix deps for ACPI tables, so that thay would be rebuild when
>     included files are touched. (Added only includes, I've touched,
>     it's not complete but a good start anyway)
> 
> Tested with RHEL6, WS2012R2, WS2003
> 
> Series is based on mst/pci tree, git tree for testing:
> https://github.com/imammedo/qemu/commits/q35_cpu_hp_v3

I have applied this, thanks!

> Igor Mammedov (9):
>   acpi: factor out common cpu hotplug code for PIIX4/Q35
>   acpi: ich9: add CPU hotplug handling to Q35 machine
>   pc: make: fix dependencies: rebuild when included file is changed
>   pc: set PRST base in DSDT depending on chipset
>   pc: PIIX DSDT: exclude CPU/PCI hotplug & GPE0 IO range from PCI bus
>     resources
>   pc: Q35 DSDT: exclude CPU hotplug IO range from PCI bus resources
>   pc: ACPI: expose PRST IO range via _CRS
>   pc: ACPI: unify source of CPU hotplug IO base/len
>   pc: ACPI: update acpi-dsdt.hex.generated q35-acpi-dsdt.hex.generated
> 
>  docs/specs/acpi_cpu_hotplug.txt     |    4 +-
>  hw/acpi/Makefile.objs               |    2 +-
>  hw/acpi/cpu_hotplug.c               |   64 +++++++
>  hw/acpi/ich9.c                      |   14 ++
>  hw/acpi/piix4.c                     |   80 +--------
>  hw/i386/Makefile.objs               |    2 +-
>  hw/i386/acpi-dsdt-cpu-hotplug.dsl   |   14 ++-
>  hw/i386/acpi-dsdt-pci-crs.dsl       |   15 +--
>  hw/i386/acpi-dsdt.dsl               |   41 +++++
>  hw/i386/acpi-dsdt.hex.generated     |  333 +++++++++++++++++++++++++++--------
>  hw/i386/q35-acpi-dsdt.dsl           |   18 ++
>  hw/i386/q35-acpi-dsdt.hex.generated |  138 ++++++++++++--
>  include/hw/acpi/cpu_hotplug.h       |   27 +++
>  include/hw/acpi/cpu_hotplug_defs.h  |   24 +++
>  include/hw/acpi/ich9.h              |    4 +
>  15 files changed, 592 insertions(+), 188 deletions(-)
>  create mode 100644 hw/acpi/cpu_hotplug.c
>  create mode 100644 include/hw/acpi/cpu_hotplug.h
>  create mode 100644 include/hw/acpi/cpu_hotplug_defs.h

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH 7/9] pc: ACPI: expose PRST IO range via _CRS
  2014-01-09 16:36 ` [Qemu-devel] [PATCH 7/9] pc: ACPI: expose PRST IO range via _CRS Igor Mammedov
@ 2014-02-02 13:12   ` Michael S. Tsirkin
  2014-02-02 13:27     ` Igor Mammedov
  0 siblings, 1 reply; 13+ messages in thread
From: Michael S. Tsirkin @ 2014-02-02 13:12 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: hutao, mjt, qemu-devel, chen.fan.fnst, aliguori, anthony.perard,
	afaerber

On Thu, Jan 09, 2014 at 05:36:37PM +0100, Igor Mammedov wrote:
> .. so OSPM could notice resource conflict if there is any.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>

Hi Igor,
I noticed an unpleasant side effect caused by this patch.
Now, windows xp prompts me for a driver for this device
every time I boot it.

If I click cancel it goes away, but it's annoying.
I think ACPI0004 is too new for winxp to recognize it.
I tried the following patch and it seems to work fine.
What do you think?


diff --git a/hw/i386/acpi-dsdt-cpu-hotplug.dsl b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
index dee4843..34aab5a 100644
--- a/hw/i386/acpi-dsdt-cpu-hotplug.dsl
+++ b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
@@ -93,7 +93,7 @@ Scope(\_SB) {
     }
 
     Device(CPU_HOTPLUG_RESOURCE_DEVICE) {
-        Name(_HID, "ACPI0004")
+        Name(_HID, EisaId("PNP0A06"))
 
         Name(_CRS, ResourceTemplate() {
             IO(Decode16, CPU_STATUS_BASE, CPU_STATUS_BASE, 0, CPU_STATUS_LEN)



> ---
> v2:
>   * use define for DEVICE name to make it more descriptive
>   * define _STA as present,functioning, decoding, not shown in UI
> ---
>  hw/i386/acpi-dsdt-cpu-hotplug.dsl |   14 +++++++++++++-
>  1 files changed, 13 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/i386/acpi-dsdt-cpu-hotplug.dsl b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
> index 1dfbb4f..f91eafd 100644
> --- a/hw/i386/acpi-dsdt-cpu-hotplug.dsl
> +++ b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
> @@ -16,6 +16,7 @@
>  /****************************************************************
>   * CPU hotplug
>   ****************************************************************/
> +#define CPU_HOTPLUG_RESOURCE_DEVICE PRES
>  
>  Scope(\_SB) {
>      /* Objects filled in by run-time generated SSDT */
> @@ -52,7 +53,8 @@ Scope(\_SB) {
>          Sleep(200)
>      }
>  
> -    OperationRegion(PRST, SystemIO, CPU_STATUS_BASE, 32)
> +#define CPU_STATUS_LEN 32
> +    OperationRegion(PRST, SystemIO, CPU_STATUS_BASE, CPU_STATUS_LEN)
>      Field(PRST, ByteAcc, NoLock, Preserve) {
>          PRS, 256
>      }
> @@ -89,4 +91,14 @@ Scope(\_SB) {
>              Increment(Local0)
>          }
>      }
> +
> +    Device(CPU_HOTPLUG_RESOURCE_DEVICE) {
> +        Name(_HID, "ACPI0004")
> +
> +        Name(_CRS, ResourceTemplate() {
> +            IO(Decode16, CPU_STATUS_BASE, CPU_STATUS_BASE, 0, CPU_STATUS_LEN)
> +        })
> +
> +        Name(_STA, 0xB) /* present, functioning, decoding, not shown in UI */
> +    }
>  }
> -- 
> 1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH 7/9] pc: ACPI: expose PRST IO range via _CRS
  2014-02-02 13:12   ` Michael S. Tsirkin
@ 2014-02-02 13:27     ` Igor Mammedov
  0 siblings, 0 replies; 13+ messages in thread
From: Igor Mammedov @ 2014-02-02 13:27 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: hutao, mjt, qemu-devel, chen.fan.fnst, aliguori, anthony.perard,
	afaerber

On Sun, 2 Feb 2014 15:12:55 +0200
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Thu, Jan 09, 2014 at 05:36:37PM +0100, Igor Mammedov wrote:
> > .. so OSPM could notice resource conflict if there is any.
> > 
> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> 
> Hi Igor,
> I noticed an unpleasant side effect caused by this patch.
> Now, windows xp prompts me for a driver for this device
> every time I boot it.
> 
> If I click cancel it goes away, but it's annoying.
> I think ACPI0004 is too new for winxp to recognize it.
> I tried the following patch and it seems to work fine.
> What do you think?
I have patches that refactor static holes punching into
dynamic one using PNP0A02 device on PCI0 bus, but I still
testing it make sure all windows versions are happy with it,
and it's on top of hotplug refactoring series.
So I'll hold it off until hotplug refactoring series is in.

> 
> diff --git a/hw/i386/acpi-dsdt-cpu-hotplug.dsl b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
> index dee4843..34aab5a 100644
> --- a/hw/i386/acpi-dsdt-cpu-hotplug.dsl
> +++ b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
> @@ -93,7 +93,7 @@ Scope(\_SB) {
>      }
>  
>      Device(CPU_HOTPLUG_RESOURCE_DEVICE) {
> -        Name(_HID, "ACPI0004")
> +        Name(_HID, EisaId("PNP0A06"))
>  
>          Name(_CRS, ResourceTemplate() {
>              IO(Decode16, CPU_STATUS_BASE, CPU_STATUS_BASE, 0, CPU_STATUS_LEN)
> 
> 
> 
> > ---
> > v2:
> >   * use define for DEVICE name to make it more descriptive
> >   * define _STA as present,functioning, decoding, not shown in UI
> > ---
> >  hw/i386/acpi-dsdt-cpu-hotplug.dsl |   14 +++++++++++++-
> >  1 files changed, 13 insertions(+), 1 deletions(-)
> > 
> > diff --git a/hw/i386/acpi-dsdt-cpu-hotplug.dsl b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
> > index 1dfbb4f..f91eafd 100644
> > --- a/hw/i386/acpi-dsdt-cpu-hotplug.dsl
> > +++ b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
> > @@ -16,6 +16,7 @@
> >  /****************************************************************
> >   * CPU hotplug
> >   ****************************************************************/
> > +#define CPU_HOTPLUG_RESOURCE_DEVICE PRES
> >  
> >  Scope(\_SB) {
> >      /* Objects filled in by run-time generated SSDT */
> > @@ -52,7 +53,8 @@ Scope(\_SB) {
> >          Sleep(200)
> >      }
> >  
> > -    OperationRegion(PRST, SystemIO, CPU_STATUS_BASE, 32)
> > +#define CPU_STATUS_LEN 32
> > +    OperationRegion(PRST, SystemIO, CPU_STATUS_BASE, CPU_STATUS_LEN)
> >      Field(PRST, ByteAcc, NoLock, Preserve) {
> >          PRS, 256
> >      }
> > @@ -89,4 +91,14 @@ Scope(\_SB) {
> >              Increment(Local0)
> >          }
> >      }
> > +
> > +    Device(CPU_HOTPLUG_RESOURCE_DEVICE) {
> > +        Name(_HID, "ACPI0004")
> > +
> > +        Name(_CRS, ResourceTemplate() {
> > +            IO(Decode16, CPU_STATUS_BASE, CPU_STATUS_BASE, 0, CPU_STATUS_LEN)
> > +        })
> > +
> > +        Name(_STA, 0xB) /* present, functioning, decoding, not shown in UI */
> > +    }
> >  }
> > -- 
> > 1.7.1


-- 
Regards,
  Igor

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-02-02 13:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-09 16:36 [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Igor Mammedov
2014-01-09 16:36 ` [Qemu-devel] [PATCH 1/9] acpi: factor out common cpu hotplug code for PIIX4/Q35 Igor Mammedov
2014-01-09 16:36 ` [Qemu-devel] [PATCH 2/9] acpi: ich9: add CPU hotplug handling to Q35 machine Igor Mammedov
2014-01-09 16:36 ` [Qemu-devel] [PATCH 3/9] pc: make: fix dependencies: rebuild when included file is changed Igor Mammedov
2014-01-09 16:36 ` [Qemu-devel] [PATCH 4/9] pc: set PRST base in DSDT depending on chipset Igor Mammedov
2014-01-09 16:36 ` [Qemu-devel] [PATCH 5/9] pc: PIIX DSDT: exclude CPU/PCI hotplug & GPE0 IO range from PCI bus resources Igor Mammedov
2014-01-09 16:36 ` [Qemu-devel] [PATCH 6/9] pc: Q35 DSDT: exclude CPU hotplug " Igor Mammedov
2014-01-09 16:36 ` [Qemu-devel] [PATCH 7/9] pc: ACPI: expose PRST IO range via _CRS Igor Mammedov
2014-02-02 13:12   ` Michael S. Tsirkin
2014-02-02 13:27     ` Igor Mammedov
2014-01-09 16:36 ` [Qemu-devel] [PATCH 8/9] pc: ACPI: unify source of CPU hotplug IO base/len Igor Mammedov
2014-01-09 16:36 ` [Qemu-devel] [PATCH 9/9] pc: ACPI: update acpi-dsdt.hex.generated q35-acpi-dsdt.hex.generated Igor Mammedov
2014-01-16 10:35 ` [Qemu-devel] [PATCH 0/9 v3] pc: CPU hotplug support for Q35 Michael S. Tsirkin

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.