From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>, qemu-arm@nongnu.org
Subject: Re: [PATCH 07/11] hw/acpi: Prefer cached CpuClass over CPU_GET_CLASS() macro
Date: Tue, 21 Jan 2025 07:58:52 -0800 [thread overview]
Message-ID: <b28eb9b2-750d-4297-80f3-36fda01ba94d@linaro.org> (raw)
In-Reply-To: <20250121114056.53949-8-philmd@linaro.org>
On 1/21/25 03:40, Philippe Mathieu-Daudé wrote:
> 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>
> ---
> hw/acpi/cpu.c | 4 ++--
> hw/acpi/cpu_hotplug.c | 3 +--
> 2 files changed, 3 insertions(+), 4 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
>
> 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);
next prev parent reply other threads:[~2025-01-21 15:59 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-21 11:40 [PATCH 00/11] cpus: Prefer cached CpuClass over CPU_GET_CLASS() macro Philippe Mathieu-Daudé
2025-01-21 11:40 ` [PATCH 01/11] cpus: Cache CPUClass early in instance_init() handler Philippe Mathieu-Daudé
2025-01-21 15:54 ` Richard Henderson
2025-01-21 11:40 ` [PATCH 02/11] cpus: Prefer cached CpuClass over CPU_GET_CLASS() macro Philippe Mathieu-Daudé
2025-01-21 15:55 ` Richard Henderson
2025-01-21 11:40 ` [PATCH 03/11] accel: " Philippe Mathieu-Daudé
2025-01-21 15:56 ` Richard Henderson
2025-01-21 11:40 ` [PATCH 04/11] user: " Philippe Mathieu-Daudé
2025-01-21 15:57 ` Richard Henderson
2025-01-21 11:40 ` [PATCH 05/11] disas: " Philippe Mathieu-Daudé
2025-01-21 15:57 ` Richard Henderson
2025-01-21 11:40 ` [PATCH 06/11] gdbstub: " Philippe Mathieu-Daudé
2025-01-21 12:43 ` Alex Bennée
2025-01-21 15:58 ` Richard Henderson
2025-01-21 11:40 ` [PATCH 07/11] hw/acpi: " Philippe Mathieu-Daudé
2025-01-21 15:58 ` Richard Henderson [this message]
2025-01-21 11:40 ` [PATCH 08/11] hw/core/generic-loader: Prefer cached CpuClass over CPU_GET_CLASS macro Philippe Mathieu-Daudé
2025-01-21 18:53 ` Philippe Mathieu-Daudé
2025-01-21 11:40 ` [PATCH 09/11] target/arm: Prefer cached CpuClass over CPU_GET_CLASS() macro Philippe Mathieu-Daudé
2025-01-21 12:43 ` Alex Bennée
2025-01-21 11:40 ` [PATCH 10/11] target/microblaze: " Philippe Mathieu-Daudé
2025-01-21 18:54 ` Philippe Mathieu-Daudé
2025-01-21 11:40 ` [PATCH 11/11] target/openrisc: " Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b28eb9b2-750d-4297-80f3-36fda01ba94d@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).