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

Re: [XenPPC] [xenppc-unstable] [ppc] Handle 2 forms of NULL gues handle

To: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Subject: Re: [XenPPC] [xenppc-unstable] [ppc] Handle 2 forms of NULL gues handle
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Thu, 27 Jul 2006 16:13:05 -0500
Cc: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 27 Jul 2006 14:12:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <06F5DB76-4F38-4821-9DE0-C89F4F0B8032@xxxxxxxxxxxxxx>
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
References: <E1G5oJH-0001tn-Hm@xxxxxxxxxxxxxxxxxxxxx> <1154025005.3128.5.camel@xxxxxxxxxxxxxxxxxxxxx> <06F5DB76-4F38-4821-9DE0-C89F4F0B8032@xxxxxxxxxxxxxx>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Thu, 2006-07-27 at 16:37 -0400, Jimi Xenidis wrote:
> I think the correct solution (pretty sure it would cover it all)  
> would be to arrange for __xencomm_init(buffer=NULL) to set desc- 
>  >nr_addrs = 0, never touching desc->address[] and checking for  
> (nr_addrs==0) in xencomm_handle_is_null(), also reducing the number  
> of checks and assignments required to communicate "nothing"

That sounds OK to me.

I was really confused by your diff. I think this will work:

diff -r 72c8bc5d88f4 drivers/xen/core/xencomm.c
--- a/drivers/xen/core/xencomm.c        Thu Jun 29 13:04:30 2006 -0400
+++ b/drivers/xen/core/xencomm.c        Thu Jul 27 15:58:58 2006 -0500
@@ -58,6 +58,10 @@ static int __xencomm_init(struct xencomm
 {
        unsigned long recorded = 0;
        int i = 0;
+
+       /* special-case NULL pointers for easy detection on the Xen side */
+       if (buffer == NULL)
+               desc->nr_addrs = 0;

        /* record the physical pages used */
        while ((recorded < bytes) && (i < desc->nr_addrs)) {

-- 
Hollis Blanchard
IBM Linux Technology Center


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