qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 03/29] hmp: allow apic-id for "info lapic"


From: Eduardo Habkost
Subject: [Qemu-devel] [PULL 03/29] hmp: allow apic-id for "info lapic"
Date: Fri, 1 Sep 2017 12:02:51 -0300

From: Yi Wang <address@hidden>

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 <address@hidden>
Signed-off-by: Yun Liu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
 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)
 
 void hmp_info_local_apic(Monitor *mon, const QDict *qdict)
 {
-    CPUState *cs = mon_get_cpu();
+    CPUState *cs;
+
+    if (qdict_haskey(qdict, "apic-id")) {
+        int id = qdict_get_try_int(qdict, "apic-id", 0);
+        cs = cpu_by_arch_id(id);
+    } else {
+        cs = mon_get_cpu();
+    }
+
 
     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       = "lapic",
-        .args_type  = "",
-        .params     = "",
-        .help       = "show local apic state",
+        .args_type  = "apic-id:i?",
+        .params     = "[apic-id]",
+        .help       = "show local apic state (apic-id: local apic to read, 
default is which of current CPU)",
+
         .cmd        = hmp_info_local_apic,
     },
 #endif
-- 
2.13.5




reply via email to

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