qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Patch] Support translating Guest physical address to Host virtual address.
@ 2010-01-27  3:25 Zheng, Jiajia
  2010-01-27 21:39 ` Anthony Liguori
  0 siblings, 1 reply; 17+ messages in thread
From: Zheng, Jiajia @ 2010-01-27  3:25 UTC (permalink / raw)
  To: avi@redhat.com, lmr@redhat.com, qemu-devel@nongnu.org
  Cc: Kleen, Andi, Li, Haicheng, Max Asbock, You, Yongkang

Add command p2v to translate Guest physical address to Host virtual address. 

Signed-off-by: Max Asbock <masbock@linux.vnet.ibm.com>
		   Jiajia Zheng <jiajia.zheng@intel.com>
---
diff --git a/monitor.c b/monitor.c
index b33b01f..83d9ac7 100644
--- a/monitor.c
+++ b/monitor.c
@@ -668,6 +668,11 @@ static void do_info_uuid(Monitor *mon, QObject **ret_data)
     *ret_data = qobject_from_jsonf("{ 'UUID': %s }", uuid);
 }
 
+static void do_info_p2v(Monitor *mon)
+{
+    monitor_printf(mon, "p2v implemented\n");
+}
+
 /* get the current CPU defined by the user */
 static int mon_set_cpu(int cpu_index)
 {
@@ -2283,6 +2288,14 @@ static void do_inject_mce(Monitor *mon, const QDict *qdict)
             break;
         }
 }
+static void do_p2v(Monitor *mon, const QDict *qdict)
+{
+    target_long size = 4096;
+    target_long addr = qdict_get_int(qdict, "addr");
+
+    monitor_printf(mon, "Guest physical address %p is mapped at host virtual address %p\n", (void *)addr, cpu_physical_memory_map( (target_phys_addr_t)addr, (target_phys_addr_t *)&size, 0));
+}
+
 #endif
 
 static void do_getfd(Monitor *mon, const QDict *qdict, QObject **ret_data)
@@ -2659,6 +2672,13 @@ static const mon_cmd_t info_cmds[] = {
         .mhandler.info = do_info_qdm,
     },
     {
+        .name       = "p2v",
+        .args_type  = "",
+        .params     = "",
+        .help       = "translate guest physical to host virtual address",
+        .mhandler.info = do_info_p2v,
+    },
+    {
         .name       = "roms",
         .args_type  = "",
         .params     = "",
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 9e3ea3c..ab9743c 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -326,6 +326,16 @@ Start gdbserver session (default @var{port}=1234)
 ETEXI
 
     {
+        .name       = "p2v",
+        .args_type  = "fmt:/,addr:l",
+        .params     = "/fmt addr",
+        .help       = "translate guest physical 'addr' to host virtual address",
+        .mhandler.cmd = do_p2v,
+    },
+STEXI
+ETEXI
+
+    {
         .name       = "x",
         .args_type  = "fmt:/,addr:l",
         .params     = "/fmt addr",

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-02-08  8:43 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-27  3:25 [Qemu-devel] [Patch] Support translating Guest physical address to Host virtual address Zheng, Jiajia
2010-01-27 21:39 ` Anthony Liguori
2010-01-27 22:31   ` Max Asbock
2010-02-03  4:04     ` Zheng, Jiajia
2010-02-03 13:41       ` Anthony Liguori
2010-02-03 14:11         ` Kleen, Andi
2010-02-03 14:23           ` Anthony Liguori
2010-02-03 15:29             ` Lucas Meneghel Rodrigues
2010-02-03 15:49             ` Kleen, Andi
2010-02-03 16:14               ` Anthony Liguori
2010-02-05  2:07                 ` Zheng, Jiajia
2010-02-07 14:03                 ` Avi Kivity
2010-02-07 16:23                   ` Anthony Liguori
2010-02-07 16:31                     ` Avi Kivity
2010-02-07 22:09                       ` Anthony Liguori
2010-02-08  3:38                         ` Zheng, Jiajia
2010-02-08  8:43                         ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).