From nobody Tue Feb 10 07:23:02 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1648646472510481.12537271207884; Wed, 30 Mar 2022 06:21:12 -0700 (PDT) Received: from localhost ([::1]:48004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZYG4-0006gw-Rv for importer@patchew.org; Wed, 30 Mar 2022 09:21:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZXsf-0006oo-Ui; Wed, 30 Mar 2022 08:56:59 -0400 Received: from beetle.greensocs.com ([5.135.226.135]:41060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZXsb-0004Zd-HK; Wed, 30 Mar 2022 08:56:55 -0400 Received: from crumble.bar.greensocs.com (unknown [172.17.10.6]) by beetle.greensocs.com (Postfix) with ESMTPS id 6340A21EBE; Wed, 30 Mar 2022 12:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=greensocs.com; s=mail; t=1648645008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tNtuXMP17Wp2ohzLpSDIDcwKal0f30KwuZn+3sGkw34=; b=j7cNcWesJw3SwK0OSEqzP8OfWQAuxuBd6W2/1/Rk8xGxye2b2yaVZOjCHsEoQ9z14lCWkB ynCy4HfV+8QFG6eAcNDaxePQUM0s95UNZBsnx0cz9DugP8X9z5/a2rHAPSToM8/Y9j5C2F Gzvgk3pyIhXFdTmKyq7mevp125SKAiE= From: Damien Hedde To: qemu-devel@nongnu.org Subject: [RFC PATCH 05/18] gdbstub: deal with _cpus_ object instead of _cpu-cluster_ Date: Wed, 30 Mar 2022 14:56:26 +0200 Message-Id: <20220330125639.201937-6-damien.hedde@greensocs.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220330125639.201937-1-damien.hedde@greensocs.com> References: <20220330125639.201937-1-damien.hedde@greensocs.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam: Yes Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=5.135.226.135; envelope-from=damien.hedde@greensocs.com; helo=beetle.greensocs.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Damien Hedde , Peter Maydell , Bin Meng , qemu-riscv@nongnu.org, Alistair Francis , mark.burton@greensocs.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Eduardo Habkost , qemu-arm@nongnu.org, Palmer Dabbelt , Vijai Kumar K , "Edgar E. Iglesias" , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1648646475415100001 Content-Type: text/plain; charset="utf-8" The gdbstub will only handle _cpus_ object having set the _is_cluster_ flag. Signed-off-by: Damien Hedde --- gdbstub.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index c8375e3c3f..0b3e943f95 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -38,7 +38,7 @@ #include "monitor/monitor.h" #include "chardev/char.h" #include "chardev/char-fe.h" -#include "hw/cpu/cluster.h" +#include "hw/cpu/cpus.h" #include "hw/boards.h" #endif =20 @@ -3458,9 +3458,10 @@ static const TypeInfo char_gdb_type_info =3D { =20 static int find_cpu_clusters(Object *child, void *opaque) { - if (object_dynamic_cast(child, TYPE_CPU_CLUSTER)) { + if (object_dynamic_cast(child, TYPE_CPUS) && + CPUS(child)->is_cluster) { GDBState *s =3D (GDBState *) opaque; - CPUClusterState *cluster =3D CPU_CLUSTER(child); + CpusState *cluster =3D CPUS(child); GDBProcess *process; =20 s->processes =3D g_renew(GDBProcess, s->processes, ++s->process_nu= m); @@ -3472,8 +3473,9 @@ static int find_cpu_clusters(Object *child, void *opa= que) * runtime, we enforce here that the machine does not use a cluste= r ID * that would lead to PID 0. */ - assert(cluster->cluster_id !=3D UINT32_MAX); - process->pid =3D cluster->cluster_id + 1; + assert(cluster->cluster_index >=3D 0 && + cluster->cluster_index < UINT32_MAX); + process->pid =3D cluster->cluster_index + 1; process->attached =3D false; process->target_xml[0] =3D '\0'; =20 --=20 2.35.1