[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Improve commenting of xencomm_ctxt_next().



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1188396117 -3600
# Node ID adad9f3820f17762ab23ca1bfb879cf310e87e04
# Parent  828e1df114d4b59ebc0a84db3b079f7087fc9b20
Improve commenting of xencomm_ctxt_next().
Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 xen/common/xencomm.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletion(-)

diff -r 828e1df114d4 -r adad9f3820f1 xen/common/xencomm.c
--- a/xen/common/xencomm.c      Wed Aug 29 14:57:12 2007 +0100
+++ b/xen/common/xencomm.c      Wed Aug 29 15:01:57 2007 +0100
@@ -138,6 +138,22 @@ xencomm_ctxt_init(const void *handle, st
     return 0;
 }
 
+/*
+ * Calculate the vaddr of &ctxt->desc_in_paddr->address[i] and get_page().
+ * And put the results in ctxt->page and ctxt->address.
+ * If there is the previous page, put_page().
+ *
+ * A guest domain passes the array, ctxt->desc_in_paddr->address[].
+ * It is gpaddr-contiguous, but not maddr-contiguous so that
+ * we can't obtain the vaddr by simple offsetting.
+ * We need to convert gpaddr, &ctxt->desc_in_paddr->address[i],
+ * into maddr and then convert it to the xen virtual address in order
+ * to access there.
+ * The conversion can be optimized out by using the last result of
+ * ctxt->address because we access the array sequentially.
+ * The conversion, gpaddr -> maddr -> vaddr, is necessary only when
+ * crossing page boundary.
+ */
 static int
 xencomm_ctxt_next(struct xencomm_ctxt *ctxt, int i)
 {
@@ -147,7 +163,7 @@ xencomm_ctxt_next(struct xencomm_ctxt *c
 
     BUG_ON(i >= ctxt->nr_addrs);
 
-    /* In i == 0 case, we already calculated in xecomm_addr_init(). */
+    /* For i == 0 case we already calculated it in xencomm_ctxt_init(). */
     if ( i != 0 )
         ctxt->address++;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.