|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-ia64-devel] [PATCH] Fix a bug in xencomm_copy_from/to_guest()
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |