diff mbox

[RFC,10/42] pc: piix4/ich9: add 'cpu-hotplug-legacy' property

Message ID 1462192431-146342-11-git-send-email-imammedo@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Igor Mammedov May 2, 2016, 12:33 p.m. UTC
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/acpi/ich9.c         | 19 +++++++++++++++++++
 hw/acpi/piix4.c        |  3 +++
 include/hw/acpi/ich9.h |  1 +
 3 files changed, 23 insertions(+)

Comments

Eduardo Habkost May 10, 2016, 8:19 p.m. UTC | #1
On Mon, May 02, 2016 at 02:33:19PM +0200, Igor Mammedov wrote:
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>

As the property is useless if no code is reading
s->pm.cpu_hotplug_legacy. What about squashing patches 10/42 and
12/42 together?
Igor Mammedov May 11, 2016, 1:33 p.m. UTC | #2
On Tue, 10 May 2016 17:19:35 -0300
Eduardo Habkost <ehabkost@redhat.com> wrote:

> On Mon, May 02, 2016 at 02:33:19PM +0200, Igor Mammedov wrote:
> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>  
> 
> As the property is useless if no code is reading
> s->pm.cpu_hotplug_legacy. What about squashing patches 10/42 and
> 12/42 together?
I've thought splitting trivial boiler plate code for adding property
would make it smaller/easier to review.
But I'm ok with squashing it into 12/42 if it makes review easier.
diff mbox

Patch

diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index af340d0..1cfe832 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -306,6 +306,21 @@  static void ich9_pm_set_memory_hotplug_support(Object *obj, bool value,
     s->pm.acpi_memory_hotplug.is_enabled = value;
 }
 
+static bool ich9_pm_get_cpu_hotplug_legacy(Object *obj, Error **errp)
+{
+    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
+
+    return s->pm.cpu_hotplug_legacy;
+}
+
+static void ich9_pm_set_cpu_hotplug_legacy(Object *obj, bool value,
+                                           Error **errp)
+{
+    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
+
+    s->pm.cpu_hotplug_legacy = value;
+}
+
 static void ich9_pm_get_disable_s3(Object *obj, Visitor *v, const char *name,
                                    void *opaque, Error **errp)
 {
@@ -412,6 +427,10 @@  void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
                              ich9_pm_get_memory_hotplug_support,
                              ich9_pm_set_memory_hotplug_support,
                              NULL);
+    object_property_add_bool(obj, "cpu-hotplug-legacy",
+                             ich9_pm_get_cpu_hotplug_legacy,
+                             ich9_pm_set_cpu_hotplug_legacy,
+                             NULL);
     object_property_add(obj, ACPI_PM_PROP_S3_DISABLED, "uint8",
                         ich9_pm_get_disable_s3,
                         ich9_pm_set_disable_s3,
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 3e8d80b..7b5c312 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -85,6 +85,7 @@  typedef struct PIIX4PMState {
     uint8_t disable_s4;
     uint8_t s4_val;
 
+    bool cpu_hotplug_legacy;
     AcpiCpuHotplug gpe_cpu;
 
     MemHotplugState acpi_memory_hotplug;
@@ -594,6 +595,8 @@  static Property piix4_pm_properties[] = {
                      use_acpi_pci_hotplug, true),
     DEFINE_PROP_BOOL("memory-hotplug-support", PIIX4PMState,
                      acpi_memory_hotplug.is_enabled, true),
+    DEFINE_PROP_BOOL("cpu-hotplug-legacy", PIIX4PMState,
+                     cpu_hotplug_legacy, false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index 63fa198..942b966 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -48,6 +48,7 @@  typedef struct ICH9LPCPMRegs {
     uint32_t pm_io_base;
     Notifier powerdown_notifier;
 
+    bool cpu_hotplug_legacy;
     AcpiCpuHotplug gpe_cpu;
 
     MemHotplugState acpi_memory_hotplug;