WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH][kdb] Implement dbg_rw_hvm_mem

To: mukesh.rathor@xxxxxxxxxx
Subject: [Xen-devel] [PATCH][kdb] Implement dbg_rw_hvm_mem
From: Ben Guthro <bguthro@xxxxxxxxxxxxxxx>
Date: Tue, 03 Jun 2008 15:28:05 -0400
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 03 Jun 2008 12:28:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080501)
The following patch does 2 things:
- Correct a bug confusing XEN_SUBVERSION with XEN_VERSION - preventing kdb working on xen 3.2
- Implement dbg_rw_hvm_mem for Xen 3.X hypervisors


diff -r 7e82d2b0a20d xen/arch/x86/debug.c
--- a/xen/arch/x86/debug.c
+++ b/xen/arch/x86/debug.c
@@ -34,12 +34,15 @@
 typedef unsigned char dbgbyte_t;
 
 
-#if XEN_SUBVERSION >= 3             /* xen 3.x.x */
+#if XEN_VERSION >= 3             /* xen 3.x.x */
 static noinline int
 dbg_rw_hvm_mem(dbgva_t addr, dbgbyte_t *buf, int len, struct domain *dp,
                int toaddr)
 {
-       return len;
+        if ( toaddr ) 
+                return hvm_copy_to_guest_virt(addr, buf, len) == HVMCOPY_okay;
+        else 
+                return hvm_copy_from_guest_virt(buf, addr, len) == 
HVMCOPY_okay;         
 }
 
 #else
@@ -82,7 +85,7 @@
        return len;
 }
 
-#endif /* XEN_SUBVERSION >= 3 */
+#endif /* XEN_VERSION >= 3 */
 
 
 /*
diff -r 7e82d2b0a20d xen/kdb/kdb_cmds.c
--- a/xen/kdb/kdb_cmds.c
+++ b/xen/kdb/kdb_cmds.c
@@ -658,7 +658,7 @@
        return KDB_CPU_MAIN_KDB;
 }
 
-#if XEN_SUBVERSION >= 3             /* xen 3.x.x */
+#if XEN_VERSION >= 3             /* xen 3.x.x */
 struct  Xgt_desc_struct {
         unsigned short size;
         unsigned long address __attribute__((packed));
@@ -1496,7 +1496,7 @@
 kdb_cpu_cmd_t
 kdb_cmdf_reboot(int argc, const char **argv, struct cpu_user_regs *regs)
 {
-#if XEN_SUBVERSION >= 3             /* xen 3.x.x */
+#if XEN_VERSION >= 3             /* xen 3.x.x */
        machine_restart();
 #else
        machine_restart("");
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>