[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/26] hw: acpi: Do not create hotplug method when h
From: |
Samuel Ortiz |
Subject: |
[Qemu-devel] [PATCH 10/26] hw: acpi: Do not create hotplug method when handler is not defined |
Date: |
Mon, 22 Oct 2018 20:36:40 +0200 |
CPU and memory ACPI hotplug are not necessarily handled through SCI
events. For example, with Hardware-reduced ACPI, the GED device will
manage ACPI hotplug entirely.
As a consequence, we make the CPU and memory specific events AML
generation optional. The code will only be added when the method name is
not NULL.
Cc: "Michael S. Tsirkin" <address@hidden>
Cc: Igor Mammedov <address@hidden>
Signed-off-by: Samuel Ortiz <address@hidden>
---
hw/acpi/cpu.c | 8 +++++---
hw/acpi/memory_hotplug.c | 11 +++++++----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
index f10b190019..cd41377b5a 100644
--- a/hw/acpi/cpu.c
+++ b/hw/acpi/cpu.c
@@ -569,9 +569,11 @@ void build_cpus_aml(Aml *table, MachineState *machine,
CPUHotplugFeatures opts,
aml_append(sb_scope, cpus_dev);
aml_append(table, sb_scope);
- method = aml_method(event_handler_method, 0, AML_NOTSERIALIZED);
- aml_append(method, aml_call0("\\_SB.CPUS." CPU_SCAN_METHOD));
- aml_append(table, method);
+ if (event_handler_method) {
+ method = aml_method(event_handler_method, 0, AML_NOTSERIALIZED);
+ aml_append(method, aml_call0("\\_SB.CPUS." CPU_SCAN_METHOD));
+ aml_append(table, method);
+ }
g_free(cphp_res_path);
}
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index 8c7c1013f3..db2c4df961 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -715,10 +715,13 @@ void build_memory_hotplug_aml(Aml *table, uint32_t nr_mem,
}
aml_append(table, dev_container);
- method = aml_method(event_handler_method, 0, AML_NOTSERIALIZED);
- aml_append(method,
- aml_call0(MEMORY_DEVICES_CONTAINER "." MEMORY_SLOT_SCAN_METHOD));
- aml_append(table, method);
+ if (event_handler_method) {
+ method = aml_method(event_handler_method, 0, AML_NOTSERIALIZED);
+ aml_append(method,
+ aml_call0(MEMORY_DEVICES_CONTAINER "."
+ MEMORY_SLOT_SCAN_METHOD));
+ aml_append(table, method);
+ }
g_free(mhp_res_path);
}
--
2.17.2
- [Qemu-devel] [PATCH 02/26] hw: acpi: Export ACPI build alignment API, (continued)
- [Qemu-devel] [PATCH 02/26] hw: acpi: Export ACPI build alignment API, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 01/26] hw: i386: Decouple the ACPI build from the PC machine type, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 03/26] hw: acpi: Export the RSDP build API, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 04/26] hw: arm: Switch to the AML build RSDP building routine, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 06/26] hw: acpi: Factorize _OSC AML across architectures, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 05/26] hw: acpi: Generalize AML build routines, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 07/26] hw: i386: Refactor PCI host getter, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 11/26] hw: i386: Make the hotpluggable memory size property more generic, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 13/26] hw: acpi: Fix memory hotplug AML generation error, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 10/26] hw: acpi: Do not create hotplug method when handler is not defined,
Samuel Ortiz <=
- [Qemu-devel] [PATCH 12/26] hw: acpi: Export the SRAT AML build API, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 09/26] hw: acpi: Export the MCFG getter, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 08/26] hw: acpi: Export and generalize the PCI host AML API, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 14/26] hw: acpi: Export the PCI hotplug API, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 15/26] hw: acpi: Retrieve the PCI bus from AcpiPciHpState, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 16/26] hw: fw-build: Add firmware build methods and state, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 17/26] hw: i386: Convert PC machine type to firmware build methods, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 19/26] hw: acpi: reduced: Add MCFG support, Samuel Ortiz, 2018/10/22
- [Qemu-devel] [PATCH 18/26] hw: acpi: Initial hardware-reduced support, Samuel Ortiz, 2018/10/22