pc: acpi: cpuhp: move \_GPE._E02() into SSDT
authorIgor Mammedov <imammedo@redhat.com>
Mon, 28 Dec 2015 17:02:27 +0000 (18:02 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Sat, 9 Jan 2016 21:20:17 +0000 (23:20 +0200)
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/acpi/cpu_hotplug_acpi_table.c
hw/i386/acpi-build.c
hw/i386/acpi-dsdt-cpu-hotplug.dsl [deleted file]
hw/i386/acpi-dsdt.dsl
hw/i386/q35-acpi-dsdt.dsl
include/hw/acpi/cpu_hotplug.h
include/hw/acpi/pc-hotplug.h

index 8dda4f423fb219915ad64fe0f0a9a08a89ecb127..13b210ea8928735b2ce83f30b9b513588753e1d3 100644 (file)
@@ -71,7 +71,7 @@ void build_cpu_hotplug_aml(Aml *ctx)
     aml_append(method, aml_sleep(200));
     aml_append(sb_scope, method);
 
-    method = aml_method(stringify(CPU_SCAN_METHOD), 0, AML_NOTSERIALIZED);
+    method = aml_method(CPU_SCAN_METHOD, 0, AML_NOTSERIALIZED);
     {
         Aml *while_ctx, *if_ctx2, *else_ctx2;
         Aml *bus_check_evt = aml_int(1);
index 6c5d09a26da784b637bb5fe721799f35f67fef1f..9f1ead3f29f5d385d8897e0069aacff96303fa96 100644 (file)
@@ -1085,9 +1085,15 @@ build_ssdt(GArray *table_data, GArray *linker,
                              pm->mem_hp_io_len);
 
     scope =  aml_scope("\\_GPE");
-    method = aml_method("_E03", 0, AML_NOTSERIALIZED);
-    aml_append(method, aml_call0(MEMORY_HOTPLUG_HANDLER_PATH));
-    aml_append(scope, method);
+    {
+        method = aml_method("_E02", 0, AML_NOTSERIALIZED);
+        aml_append(method, aml_call0("\\_SB." CPU_SCAN_METHOD));
+        aml_append(scope, method);
+
+        method = aml_method("_E03", 0, AML_NOTSERIALIZED);
+        aml_append(method, aml_call0(MEMORY_HOTPLUG_HANDLER_PATH));
+        aml_append(scope, method);
+    }
     aml_append(ssdt, scope);
 
     bus = PC_MACHINE(machine)->bus;
diff --git a/hw/i386/acpi-dsdt-cpu-hotplug.dsl b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
deleted file mode 100644 (file)
index 88c472b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-/****************************************************************
- * CPU hotplug
- ****************************************************************/
-
-Scope(\_SB) {
-    /* Objects filled in by run-time generated SSDT */
-    External(CPU_SCAN_METHOD, MethodObj)
-}
index 6a0c656b1dcd8fa2e07ac9dff21481fa0c56e586..007d3c959353071130aecc6267ca2c450c5e3797 100644 (file)
@@ -247,11 +247,6 @@ DefinitionBlock (
         }
     }
 
-#include "hw/acpi/pc-hotplug.h"
-#define CPU_STATUS_BASE PIIX4_CPU_HOTPLUG_IO_BASE
-#include "acpi-dsdt-cpu-hotplug.dsl"
-
-
 /****************************************************************
  * General purpose events
  ****************************************************************/
@@ -266,10 +261,6 @@ DefinitionBlock (
             \_SB.PCI0.PCNT()
             Release(\_SB.PCI0.BLCK)
         }
-        Method(_E02) {
-            // CPU hotplug event
-            \_SB.CPU_SCAN_METHOD()
-        }
         Method(_L04) {
         }
         Method(_L05) {
index 7211665a50d50934bf6abacc842da986f8745a88..0511e26b596185b67c31f7084d22e62fd4cc6f9c 100644 (file)
@@ -384,11 +384,6 @@ DefinitionBlock (
         define_gsi_link(GSIH, 0, 0x17)
     }
 
-#include "hw/acpi/pc-hotplug.h"
-#define CPU_STATUS_BASE ICH9_CPU_HOTPLUG_IO_BASE
-#include "acpi-dsdt-cpu-hotplug.dsl"
-
-
 /****************************************************************
  * General purpose events
  ****************************************************************/
@@ -399,10 +394,6 @@ DefinitionBlock (
         }
         Method(_L01) {
         }
-        Method(_E02) {
-            // CPU hotplug event
-            \_SB.CPU_SCAN_METHOD()
-        }
         Method(_L04) {
         }
         Method(_L05) {
index 255e70c2b727fa1da791d8668a61ab3613cd2da0..f22640e389fef8b7060b999f41a50b6da286e583 100644 (file)
@@ -32,6 +32,7 @@ void acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,
 #define CPU_ON_BITMAP "CPON"
 #define CPU_STATUS_METHOD "CPST"
 #define CPU_STATUS_MAP "PRS"
+#define CPU_SCAN_METHOD "PRSC"
 
 void build_cpu_hotplug_aml(Aml *ctx);
 #endif
index 6522745c2202bcf043fb231a05c8edca2e7dfd87..6a8d268f846ada6fe497093c9559dba5780dfba8 100644 (file)
@@ -28,7 +28,6 @@
 #define ICH9_CPU_HOTPLUG_IO_BASE 0x0CD8
 #define PIIX4_CPU_HOTPLUG_IO_BASE 0xaf00
 #define CPU_HOTPLUG_RESOURCE_DEVICE PRES
-#define CPU_SCAN_METHOD PRSC
 
 #define ACPI_MEMORY_HOTPLUG_IO_LEN 24
 #define ACPI_MEMORY_HOTPLUG_BASE 0x0a00