73 lines
3.0 KiB
Diff
73 lines
3.0 KiB
Diff
|
|
From c75a0102a1bb00190b07b06ede8b1f9fa0bdaa3c Mon Sep 17 00:00:00 2001
|
||
|
|
From: Keqian Zhu <zhukeqian1@huawei.com>
|
||
|
|
Date: Tue, 2 Apr 2024 16:52:10 +0800
|
||
|
|
Subject: [PATCH] acpi/cpu: Add cpu_cppc building support
|
||
|
|
|
||
|
|
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
|
||
|
|
---
|
||
|
|
hw/acpi/cpu.c | 8 +++++++-
|
||
|
|
hw/i386/acpi-build.c | 2 +-
|
||
|
|
include/hw/acpi/cpu.h | 6 +++++-
|
||
|
|
3 files changed, 13 insertions(+), 3 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
|
||
|
|
index cf0c7e8538..c8c11e51c6 100644
|
||
|
|
--- a/hw/acpi/cpu.c
|
||
|
|
+++ b/hw/acpi/cpu.c
|
||
|
|
@@ -342,7 +342,9 @@ const VMStateDescription vmstate_cpu_hotplug = {
|
||
|
|
#define CPU_FW_EJECT_EVENT "CEJF"
|
||
|
|
|
||
|
|
void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
|
||
|
|
- build_madt_cpu_fn build_madt_cpu, hwaddr base_addr,
|
||
|
|
+ build_madt_cpu_fn build_madt_cpu,
|
||
|
|
+ build_cpu_cppc_fn build_cpu_cppc,
|
||
|
|
+ hwaddr base_addr,
|
||
|
|
const char *res_root,
|
||
|
|
const char *event_handler_method,
|
||
|
|
AmlRegionSpace rs)
|
||
|
|
@@ -668,6 +670,10 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
|
||
|
|
aml_append(dev, aml_name_decl("_UID", uid));
|
||
|
|
}
|
||
|
|
|
||
|
|
+ if (build_cpu_cppc) {
|
||
|
|
+ build_cpu_cppc(i, arch_ids->len, dev);
|
||
|
|
+ }
|
||
|
|
+
|
||
|
|
method = aml_method("_STA", 0, AML_SERIALIZED);
|
||
|
|
aml_append(method, aml_return(aml_call1(CPU_STS_METHOD, uid)));
|
||
|
|
aml_append(dev, method);
|
||
|
|
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
|
||
|
|
index db4ca8a66a..e10799ecc6 100644
|
||
|
|
--- a/hw/i386/acpi-build.c
|
||
|
|
+++ b/hw/i386/acpi-build.c
|
||
|
|
@@ -1545,7 +1545,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
|
||
|
|
.smi_path = pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL,
|
||
|
|
.fw_unplugs_cpu = pm->smi_on_cpu_unplug,
|
||
|
|
};
|
||
|
|
- build_cpus_aml(dsdt, machine, opts, pc_madt_cpu_entry,
|
||
|
|
+ build_cpus_aml(dsdt, machine, opts, pc_madt_cpu_entry, NULL,
|
||
|
|
pm->cpu_hp_io_base, "\\_SB.PCI0", "\\_GPE._E02",
|
||
|
|
AML_SYSTEM_IO);
|
||
|
|
}
|
||
|
|
diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h
|
||
|
|
index 76bc7eb251..b31a2e50d9 100644
|
||
|
|
--- a/include/hw/acpi/cpu.h
|
||
|
|
+++ b/include/hw/acpi/cpu.h
|
||
|
|
@@ -59,8 +59,12 @@ typedef struct CPUHotplugFeatures {
|
||
|
|
typedef void (*build_madt_cpu_fn)(int uid, const CPUArchIdList *apic_ids,
|
||
|
|
GArray *entry, bool force_enabled);
|
||
|
|
|
||
|
|
+typedef void (*build_cpu_cppc_fn)(int uid, int num_cpu, Aml *dev);
|
||
|
|
+
|
||
|
|
void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
|
||
|
|
- build_madt_cpu_fn build_madt_cpu, hwaddr base_addr,
|
||
|
|
+ build_madt_cpu_fn build_madt_cpu,
|
||
|
|
+ build_cpu_cppc_fn build_cpu_cppc,
|
||
|
|
+ hwaddr base_addr,
|
||
|
|
const char *res_root,
|
||
|
|
const char *event_handler_method,
|
||
|
|
AmlRegionSpace rs);
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|