qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH] target/arm/arm-powerctl: Restrict to ARM cores


From: Daniel Henrique Barboza
Subject: Re: [RFC PATCH] target/arm/arm-powerctl: Restrict to ARM cores
Date: Mon, 6 Jan 2025 16:09:29 -0300
User-agent: Mozilla Thunderbird



On 1/6/25 3:23 PM, Philippe Mathieu-Daudé wrote:
When running on a heterogeneous setup, the CPU_FOREACH()
macro in arm_get_cpu_by_id() iterates on all vCPUs,
regardless they are ARM or not. Check the CPU class type
and skip the non-ARM instances.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

  target/arm/arm-powerctl.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c
index 20c70c7d6bb..a080a6ab79f 100644
--- a/target/arm/arm-powerctl.c
+++ b/target/arm/arm-powerctl.c
@@ -36,9 +36,11 @@ CPUState *arm_get_cpu_by_id(uint64_t id)
      DPRINTF("cpu %" PRId64 "\n", id);
CPU_FOREACH(cpu) {
-        ARMCPU *armcpu = ARM_CPU(cpu);
+        if (!object_class_dynamic_cast((ObjectClass *)cpu->cc, TYPE_ARM_CPU)) {
+            continue;
+        }
- if (arm_cpu_mp_affinity(armcpu) == id) {
+        if (arm_cpu_mp_affinity((ARMCPU *)cpu) == id) {
              return cpu;
          }
      }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]