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: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [XenPPC] [xenppc-unstable] [ppc] Handle 2 forms of NULL gues handle
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Thu, 27 Jul 2006 13:30:05 -0500
Delivery-date: Thu, 27 Jul 2006 11:29:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <E1G5oJH-0001tn-Hm@xxxxxxxxxxxxxxxxxxxxx>
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>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, 2006-07-26 at 18:40 +0000, Xen patchbot-xenppc-unstable wrote:
> diff -r 518e13229929 -r 50ef9c9c717c xen/arch/powerpc/usercopy.c
> --- a/xen/arch/powerpc/usercopy.c       Thu Jul 13 11:25:36 2006 -0400
> +++ b/xen/arch/powerpc/usercopy.c       Thu Jul 13 11:26:51 2006 -0400
> @@ -231,3 +231,12 @@ void xencomm_add_offset(void *handle, un
>          bytes -= chunk_skip;
>      }
>  }
> +
> +int xencomm_handle_is_null(void *ptr)
> +{
> +    struct xencomm_desc *desc;
> +
> +    desc = (struct xencomm_desc *)paddr_to_maddr((unsigned long)ptr);
> +
> +    return (desc->address[0] == XENCOMM_INVALID);
> +} 

You can see how the function just above, xencomm_add_offset(),
overwrites the addresses with XENCOMM_INVALID. I think this incremental
patch is needed:

diff -r 42213c6e1928 xen/arch/powerpc/usercopy.c
--- a/xen/arch/powerpc/usercopy.c       Wed Jul 26 14:27:51 2006 -0400
+++ b/xen/arch/powerpc/usercopy.c       Thu Jul 27 13:28:43 2006 -0500
@@ -235,8 +235,12 @@ int xencomm_handle_is_null(void *ptr)
 int xencomm_handle_is_null(void *ptr)
 {
     struct xencomm_desc *desc;
+    int i;

     desc = (struct xencomm_desc *)paddr_to_maddr((unsigned long)ptr);

-    return (desc->address[0] == XENCOMM_INVALID);
-}
+    for (i = 0; i < desc->nr_addrs; i++)
+        if (desc->address[i] != XENCOMM_INVALID)
+            return 0;
+    return 1;
+}

In other words, if there are any valid addresses at all, the handle is
not null. Comments? Does this code work for you Jimi?

-- 
Hollis Blanchard
IBM Linux Technology Center


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