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-ia64-devel

[Xen-ia64-devel] [PATCH] Fix a bug in xencomm_copy_from/to_guest()

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] Fix a bug in xencomm_copy_from/to_guest()
From: SUZUKI Kazuhiro <kaz@xxxxxxxxxxxxxx>
Date: Wed, 27 Dec 2006 18:27:26 +0900 (JST)
Delivery-date: Wed, 27 Dec 2006 01:29:31 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi all,

  I found that the HVM guest was often failed to create when I
repeated to create and destroy a HVM guest. The following message was
displayed.

Using config file "hvm.conf".
Error: (1, 'Internal error', 'Error constructing guest OS')

  I also found the message of Xen as follows.

(XEN) xencomm_paddr_to_maddr: called with bad memory address: 0x1e5b0000 - 
iip=a00000010006fe50


  This is a bug in xencomm_copy_from_guest(). In this function,
because the condition of calling xencomm_copy_chunk_from() was wrong,
it was called in an invalid destination address.
  The attached patch fixes it and also fixes xencomm_copy_to_guest().

Thanks,
KAZ

Signed-off-by: Kazuhiro Suzuki <kaz@xxxxxxxxxxxxxx>
diff -r 80c5b5914b79 xen/arch/ia64/xen/xencomm.c
--- a/xen/arch/ia64/xen/xencomm.c       Wed Dec 20 14:55:02 2006 -0700
+++ b/xen/arch/ia64/xen/xencomm.c       Wed Dec 27 18:03:10 2006 +0900
@@ -148,6 +148,13 @@ xencomm_copy_from_guest(
         pgoffset = src_paddr % PAGE_SIZE;
         chunksz = PAGE_SIZE - pgoffset;
 
+        if (chunksz <= skip) {
+            from_pos += chunksz;
+            skip -= chunksz;
+            i++;
+            continue;
+        }
+
         chunk_skip = min(chunksz, skip);
         from_pos += chunk_skip;
         chunksz -= chunk_skip;
@@ -289,6 +296,13 @@ xencomm_copy_to_guest(
         pgoffset = dest_paddr % PAGE_SIZE;
         chunksz = PAGE_SIZE - pgoffset;
 
+        if (chunksz <= skip) {
+            to_pos += chunksz;
+            skip -= chunksz;
+            i++;
+            continue;
+        }
+
         chunk_skip = min(chunksz, skip);
         to_pos += chunk_skip;
         chunksz -= chunk_skip;
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>