[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/10] hw/acpi: Prefer cached CpuClass over CPU_GET_CLASS() ma
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 09/10] hw/acpi: Prefer cached CpuClass over CPU_GET_CLASS() macro |
Date: |
Wed, 22 Jan 2025 10:30:27 +0100 |
CpuState caches its CPUClass since commit 6fbdff87062
("cpu: cache CPUClass in CPUState for hot code paths"),
use it.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
hw/acpi/cpu.c | 4 ++--
hw/acpi/cpu_hotplug.c | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
index f70a2c045e1..6f1ae79edbf 100644
--- a/hw/acpi/cpu.c
+++ b/hw/acpi/cpu.c
@@ -235,8 +235,8 @@ void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner,
static AcpiCpuStatus *get_cpu_status(CPUHotplugState *cpu_st, DeviceState *dev)
{
- CPUClass *k = CPU_GET_CLASS(dev);
- uint64_t cpu_arch_id = k->get_arch_id(CPU(dev));
+ CPUState *cpu = CPU(dev);
+ uint64_t cpu_arch_id = cpu->cc->get_arch_id(cpu);
int i;
for (i = 0; i < cpu_st->dev_count; i++) {
diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
index 83b8bc5deb8..aa0e1e3efa5 100644
--- a/hw/acpi/cpu_hotplug.c
+++ b/hw/acpi/cpu_hotplug.c
@@ -62,10 +62,9 @@ static const MemoryRegionOps AcpiCpuHotplug_ops = {
static void acpi_set_cpu_present_bit(AcpiCpuHotplug *g, CPUState *cpu,
bool *swtchd_to_modern)
{
- CPUClass *k = CPU_GET_CLASS(cpu);
int64_t cpu_id;
- cpu_id = k->get_arch_id(cpu);
+ cpu_id = cpu->cc->get_arch_id(cpu);
if ((cpu_id / 8) >= ACPI_GPE_PROC_LEN) {
object_property_set_bool(g->device, "cpu-hotplug-legacy", false,
&error_abort);
--
2.47.1
- [PATCH v2 02/10] gdbstub: Clarify no more than @gdb_num_core_regs can be accessed, (continued)
- [PATCH v2 02/10] gdbstub: Clarify no more than @gdb_num_core_regs can be accessed, Philippe Mathieu-Daudé, 2025/01/22
- [PATCH v2 04/10] cpus: Prefer cached CpuClass over CPU_GET_CLASS() macro, Philippe Mathieu-Daudé, 2025/01/22
- [PATCH v2 03/10] cpus: Cache CPUClass early in instance_init() handler, Philippe Mathieu-Daudé, 2025/01/22
- [PATCH v2 05/10] accel: Prefer cached CpuClass over CPU_GET_CLASS() macro, Philippe Mathieu-Daudé, 2025/01/22
- [PATCH v2 06/10] user: Prefer cached CpuClass over CPU_GET_CLASS() macro, Philippe Mathieu-Daudé, 2025/01/22
- [PATCH v2 07/10] disas: Prefer cached CpuClass over CPU_GET_CLASS() macro, Philippe Mathieu-Daudé, 2025/01/22
- [PATCH v2 08/10] gdbstub: Prefer cached CpuClass over CPU_GET_CLASS() macro, Philippe Mathieu-Daudé, 2025/01/22
- [PATCH v2 09/10] hw/acpi: Prefer cached CpuClass over CPU_GET_CLASS() macro,
Philippe Mathieu-Daudé <=
- [PATCH v2 10/10] target/arm: Prefer cached CpuClass over CPU_GET_CLASS() macro, Philippe Mathieu-Daudé, 2025/01/22