55 lines
2.4 KiB
Diff
55 lines
2.4 KiB
Diff
|
|
From 16d44ddb63becd559cc2185549c4b18d26feab60 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Salil Mehta <salil.mehta@huawei.com>
|
||
|
|
Date: Tue, 16 Jul 2024 12:15:00 +0100
|
||
|
|
Subject: [PATCH 65/78] hw/acpi: Update CPUs AML with cpu-(ctrl)dev change
|
||
|
|
|
||
|
|
CPUs Control device(\\_SB.PCI0) register interface for the x86 arch is IO port
|
||
|
|
based and existing CPUs AML code assumes _CRS objects would evaluate to a system
|
||
|
|
resource which describes IO Port address. But on ARM arch CPUs control
|
||
|
|
device(\\_SB.PRES) register interface is memory-mapped hence _CRS object should
|
||
|
|
evaluate to system resource which describes memory-mapped base address. Update
|
||
|
|
build CPUs AML function to accept both IO/MEMORY region spaces and accordingly
|
||
|
|
update the _CRS object.
|
||
|
|
|
||
|
|
Co-developed-by: Keqian Zhu <zhukeqian1@huawei.com>
|
||
|
|
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
|
||
|
|
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
|
||
|
|
Reviewed-by: Gavin Shan <gshan@redhat.com>
|
||
|
|
Tested-by: Vishnu Pajjuri <vishnu@os.amperecomputing.com>
|
||
|
|
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
||
|
|
Tested-by: Xianglai Li <lixianglai@loongson.cn>
|
||
|
|
Tested-by: Miguel Luis <miguel.luis@oracle.com>
|
||
|
|
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
|
||
|
|
Tested-by: Zhao Liu <zhao1.liu@intel.com>
|
||
|
|
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
|
||
|
|
Message-Id: <20240716111502.202344-6-salil.mehta@huawei.com>
|
||
|
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||
|
|
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||
|
|
Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
|
||
|
|
---
|
||
|
|
hw/acpi/cpu.c | 4 +++-
|
||
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
||
|
|
|
||
|
|
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
|
||
|
|
index 292e1daca2..5e9093991e 100644
|
||
|
|
--- a/hw/acpi/cpu.c
|
||
|
|
+++ b/hw/acpi/cpu.c
|
||
|
|
@@ -392,11 +392,13 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
|
||
|
|
aml_name_decl("_UID", aml_string("CPU Hotplug resources")));
|
||
|
|
aml_append(cpu_ctrl_dev, aml_mutex(CPU_LOCK, 0));
|
||
|
|
|
||
|
|
+ assert((rs == AML_SYSTEM_IO) || (rs == AML_SYSTEM_MEMORY));
|
||
|
|
+
|
||
|
|
crs = aml_resource_template();
|
||
|
|
if (rs == AML_SYSTEM_IO) {
|
||
|
|
aml_append(crs, aml_io(AML_DECODE16, base_addr, base_addr, 1,
|
||
|
|
ACPI_CPU_HOTPLUG_REG_LEN));
|
||
|
|
- } else {
|
||
|
|
+ } else if (rs == AML_SYSTEM_MEMORY) {
|
||
|
|
aml_append(crs, aml_memory32_fixed(base_addr,
|
||
|
|
ACPI_CPU_HOTPLUG_REG_LEN, AML_READ_WRITE));
|
||
|
|
}
|
||
|
|
--
|
||
|
|
2.39.1
|
||
|
|
|