From nobody Mon Apr 29 03:45:36 2024 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 150038440960898.62785350122203; Tue, 18 Jul 2017 06:26:49 -0700 (PDT) Received: from localhost ([::1]:56489 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXSWV-0008HZ-4F for importer@patchew.org; Tue, 18 Jul 2017 09:26:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXHMr-0007uc-UY for qemu-devel@nongnu.org; Mon, 17 Jul 2017 21:32:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXHMo-0000Od-TJ for qemu-devel@nongnu.org; Mon, 17 Jul 2017 21:32:06 -0400 Received: from out1.zte.com.cn ([202.103.147.172]:35289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXHMo-0000MD-9n for qemu-devel@nongnu.org; Mon, 17 Jul 2017 21:32:02 -0400 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 18 Jul 2017 01:31:19 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v6I1VcYg055603; Tue, 18 Jul 2017 09:31:38 +0800 (GMT-8) (envelope-from wang.yi59@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017071809314071-4152922 ; Tue, 18 Jul 2017 09:31:40 +0800 X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170718093119 From: Yi Wang To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, dgilbert@redhat.com, qemu-devel@nongnu.org Date: Mon, 17 Jul 2017 21:49:37 -0400 Message-Id: <1500342577-12486-1-git-send-email-wang.yi59@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-07-18 09:31:40, Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-07-18 09:31:34, Serialize complete at 2017-07-18 09:31:34 X-MAIL: mse01.zte.com.cn v6I1VcYg055603 X-HQIP: 127.0.0.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 202.103.147.172 X-Mailman-Approved-At: Tue, 18 Jul 2017 09:24:13 -0400 Subject: [Qemu-devel] [PATCH v2] hmp: allow cpu index 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: wang.yi59@zte.com.cn, liu.yunh@zte.com.cn, Liu.Jianjun3@zte.com.cn 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" Add [vcpu] index 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 --- hmp-commands-info.hx | 6 +++--- target/i386/monitor.c | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index d9df238..c534b03 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -115,9 +115,9 @@ ETEXI #if defined(TARGET_I386) { .name =3D "lapic", - .args_type =3D "", - .params =3D "", - .help =3D "show local apic state", + .args_type =3D "vcpu:i?", + .params =3D "[vcpu]", + .help =3D "show local apic state (vcpu: vCPU to read, defaul= t is 0)", .cmd =3D hmp_info_local_apic, }, #endif diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 77ead60..813005e 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -632,8 +632,14 @@ 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; =20 + if (qdict_haskey(qdict, "vcpu")) { + int index =3D qdict_get_try_int(qdict, "vcpu", 0); + cs =3D qemu_get_cpu(index); + } else { + cs =3D mon_get_cpu(); + } if (!cs) { monitor_printf(mon, "No CPU available\n"); return; --=20 1.8.3.1