[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/59] pc: acpi: cpuhp: move CPST() method into SSDT
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 21/59] pc: acpi: cpuhp: move CPST() method into SSDT |
Date: |
Fri, 8 Jan 2016 16:19:35 +0200 |
From: Igor Mammedov <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/acpi/cpu_hotplug.h | 1 +
hw/acpi/cpu_hotplug_acpi_table.c | 22 ++++++++++++++++++++++
hw/i386/acpi-build.c | 3 ++-
hw/i386/acpi-dsdt-cpu-hotplug.dsl | 12 ------------
4 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/include/hw/acpi/cpu_hotplug.h b/include/hw/acpi/cpu_hotplug.h
index 40b9316..0755dd3 100644
--- a/include/hw/acpi/cpu_hotplug.h
+++ b/include/hw/acpi/cpu_hotplug.h
@@ -30,6 +30,7 @@ void acpi_cpu_hotplug_init(MemoryRegion *parent, Object
*owner,
#define CPU_EJECT_METHOD "CPEJ"
#define CPU_MAT_METHOD "CPMA"
#define CPU_ON_BITMAP "CPON"
+#define CPU_STATUS_METHOD "CPST"
void build_cpu_hotplug_aml(Aml *ctx);
#endif
diff --git a/hw/acpi/cpu_hotplug_acpi_table.c b/hw/acpi/cpu_hotplug_acpi_table.c
index 69c37fa..90c4043 100644
--- a/hw/acpi/cpu_hotplug_acpi_table.c
+++ b/hw/acpi/cpu_hotplug_acpi_table.c
@@ -18,6 +18,8 @@
void build_cpu_hotplug_aml(Aml *ctx)
{
Aml *method;
+ Aml *if_ctx;
+ Aml *else_ctx;
Aml *sb_scope = aml_scope("_SB");
uint8_t madt_tmpl[8] = {0x00, 0x08, 0x00, 0x00, 0x00, 0, 0, 0};
Aml *cpu_id = aml_arg(0);
@@ -43,6 +45,26 @@ void build_cpu_hotplug_aml(Aml *ctx)
aml_append(method, aml_return(madt));
aml_append(sb_scope, method);
+ /*
+ * _STA method - return ON status of cpu
+ * cpu_id = Arg0 = Processor ID = Local APIC ID
+ * cpu_on = Local0 = CPON flag for this cpu
+ */
+ method = aml_method(CPU_STATUS_METHOD, 1, AML_NOTSERIALIZED);
+ aml_append(method,
+ aml_store(aml_derefof(aml_index(cpus_map, cpu_id)), cpu_on));
+ if_ctx = aml_if(cpu_on);
+ {
+ aml_append(if_ctx, aml_return(aml_int(0xF)));
+ }
+ aml_append(method, if_ctx);
+ else_ctx = aml_else();
+ {
+ aml_append(else_ctx, aml_return(aml_int(0x0)));
+ }
+ aml_append(method, else_ctx);
+ aml_append(sb_scope, method);
+
method = aml_method(CPU_EJECT_METHOD, 2, AML_NOTSERIALIZED);
aml_append(method, aml_sleep(200));
aml_append(sb_scope, method);
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 88299fa..69b7160 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1323,7 +1323,8 @@ build_ssdt(GArray *table_data, GArray *linker,
aml_append(dev, method);
method = aml_method("_STA", 0, AML_NOTSERIALIZED);
- aml_append(method, aml_return(aml_call1("CPST", aml_int(i))));
+ aml_append(method,
+ aml_return(aml_call1(CPU_STATUS_METHOD, aml_int(i))));
aml_append(dev, method);
method = aml_method("_EJ0", 1, AML_NOTSERIALIZED);
diff --git a/hw/i386/acpi-dsdt-cpu-hotplug.dsl
b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
index 9739191..fb75eda 100644
--- a/hw/i386/acpi-dsdt-cpu-hotplug.dsl
+++ b/hw/i386/acpi-dsdt-cpu-hotplug.dsl
@@ -24,18 +24,6 @@ Scope(\_SB) {
External(PRS, FieldUnitObj)
/* Methods called by run-time generated SSDT Processor objects */
- Method(CPST, 1, NotSerialized) {
- // _STA method - return ON status of cpu
- // Arg0 = Processor ID = Local APIC ID
- // Local0 = CPON flag for this cpu
- Store(DerefOf(Index(CPON, Arg0)), Local0)
- If (Local0) {
- Return (0xF)
- } Else {
- Return (0x0)
- }
- }
-
Method(PRSC, 0) {
// Local5 = active cpu bitmap
Store(PRS, Local5)
--
MST
- [Qemu-devel] [PULL 10/59] pc: acpi: memhp: move MHPD.MPXM method into SSDT, (continued)
- [Qemu-devel] [PULL 10/59] pc: acpi: memhp: move MHPD.MPXM method into SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 12/59] pc: acpi: memhp: move MHPD.MEJ0 method into SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 13/59] pc: acpi: memhp: move MHPD.MCRS method into SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 14/59] pc: acpi: memhp: move MHPD Device into SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 16/59] pc: acpi: memhp: move \_GPE._E03 into SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 15/59] pc: acpi: factor out memhp code from build_ssdt() into separate function, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 17/59] pc: acpi: memhp: drop not needed stringify(MEMORY_foo) usage, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 18/59] pc: acpi: drop unused CPU_STATUS_LEN from DSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 19/59] pc: acpi: cpuhp: move CPEJ() method to SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 20/59] pc: acpi: cpuhp: move CPMA() method into SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 21/59] pc: acpi: cpuhp: move CPST() method into SSDT,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 22/59] pc: acpi: cpuhp: move PRSC() method into SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 25/59] pc: acpi: move HPET from DSDT to SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 23/59] pc: acpi: cpuhp: move \_GPE._E02() into SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 24/59] pc: acpi: factor out cpu hotplug code from build_ssdt() into separate function, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 26/59] pc: acpi: move DBUG() from DSDT to SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 27/59] pc: acpi: move RTC device from DSDT to SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 28/59] pc: acpi: move KBD device from DSDT to SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 29/59] pc: acpi: move MOU device from DSDT to SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 30/59] pc: acpi: move FDC0 device from DSDT to SSDT, Michael S. Tsirkin, 2016/01/08
- [Qemu-devel] [PULL 31/59] pc: acpi: move LPT device from DSDT to SSDT, Michael S. Tsirkin, 2016/01/08