7 messages in com.xensource.lists.xen-ia64-develRe: [Xen-ia64-devel] [PATCH] Fix a bu...| From | Sent On | Attachments |
|---|---|---|
| SUZUKI Kazuhiro | 27 Dec 2006 01:27 | .patch |
| Isaku Yamahata | 27 Dec 2006 02:15 | |
| SUZUKI Kazuhiro | 27 Dec 2006 22:53 | |
| Alex Williamson | 03 Jan 2007 19:08 | |
| Isaku Yamahata | 03 Jan 2007 20:39 | |
| Alex Williamson | 04 Jan 2007 16:34 | |
| Alex Williamson | 04 Jan 2007 16:43 |
| Subject: | Re: [Xen-ia64-devel] [PATCH] Fix a bug in xencomm_copy_from/to_guest()![]() |
|---|---|
| From: | SUZUKI Kazuhiro (ka...@jp.fujitsu.com) |
| Date: | 12/27/2006 10:53:21 PM |
| List: | com.xensource.lists.xen-ia64-devel |
Hi Isaku,
Thank you for your comment. It seems good. I think that your patch is better.
Thanks, KAZ
From: Isaku Yamahata <yama...@valinux.co.jp> Subject: Re: [Xen-ia64-devel] [PATCH] Fix a bug in xencomm_copy_from/to_guest() Date: Wed, 27 Dec 2006 19:16:16 +0900
Hi Kaz.
On Wed, Dec 27, 2006 at 06:27:26PM +0900, SUZUKI Kazuhiro wrote:
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;
This condition looks odd. I guess the issues which you've seen is calling xencomm_copy_chunk_{to, from} with len = 0. (If I'm wrong, correct me.) The patch should looks like as follows. And xen/common/xencomm.c should modified similary too.
--- xen/arch/ia64/xen/xencomm.c 2006-12-21 12:05:05.000000000 +0900 +++ xen/arch/ia64/xen/xencomm.c.new 2006-12-27 19:12:19.000000000 +0900 @@ -153,7 +153,7 @@ xencomm_copy_from_guest( chunksz -= chunk_skip; skip -= chunk_skip;
- if (skip == 0) { + if (skip == 0 && chunksz > 0) { unsigned int bytes = min(chunksz, n - to_pos); int res;
@@ -295,7 +295,7 @@ xencomm_copy_to_guest( skip -= chunk_skip; dest_paddr += chunk_skip;
- if (skip == 0) { + if (skip == 0 && chunksz > 0) { unsigned int bytes = min(chunksz, n - from_pos); int res; -- yamahata
_______________________________________________ Xen-ia64-devel mailing list Xen-...@lists.xensource.com http://lists.xensource.com/xen-ia64-devel





.patch