From nobody Wed Nov 5 08:24:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504278504877796.7977437417951; Fri, 1 Sep 2017 08:08:24 -0700 (PDT) Received: from localhost ([::1]:45001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnYV-0003oE-Ls for importer@patchew.org; Fri, 01 Sep 2017 11:08:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnTl-0007mG-Hs for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnTk-0002tD-PS for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62756) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnTk-0002sq-Jo for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:28 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 74A1BC047B74; Fri, 1 Sep 2017 15:03:27 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF35778209; Fri, 1 Sep 2017 15:03:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 74A1BC047B74 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:02:51 -0300 Message-Id: <20170901150317.10380-4-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 01 Sep 2017 15:03:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/29] hmp: allow apic-id for "info lapic" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yi Wang , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yi Wang Add [apic-id] support for hmp command "info lapic", which is useful when debugging ipi and so on. Current behavior is not changed when the parameter isn't specified. Signed-off-by: Yi Wang Signed-off-by: Yun Liu Message-Id: <1501049917-4701-3-git-send-email-wang.yi59@zte.com.cn> Signed-off-by: Eduardo Habkost --- target/i386/monitor.c | 10 +++++++++- hmp-commands-info.hx | 7 ++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 77ead60437..fe7d57b6aa 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -632,7 +632,15 @@ const MonitorDef *target_monitor_defs(void) =20 void hmp_info_local_apic(Monitor *mon, const QDict *qdict) { - CPUState *cs =3D mon_get_cpu(); + CPUState *cs; + + if (qdict_haskey(qdict, "apic-id")) { + int id =3D qdict_get_try_int(qdict, "apic-id", 0); + cs =3D cpu_by_arch_id(id); + } else { + cs =3D mon_get_cpu(); + } + =20 if (!cs) { monitor_printf(mon, "No CPU available\n"); diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index d9df238a5f..4ab7fcee98 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -115,9 +115,10 @@ ETEXI #if defined(TARGET_I386) { .name =3D "lapic", - .args_type =3D "", - .params =3D "", - .help =3D "show local apic state", + .args_type =3D "apic-id:i?", + .params =3D "[apic-id]", + .help =3D "show local apic state (apic-id: local apic to rea= d, default is which of current CPU)", + .cmd =3D hmp_info_local_apic, }, #endif --=20 2.13.5