|
|
|
|
|
|
|
|
|
|
xen-ppc-devel
Re: [XenPPC] [xenppc-unstable] [ppc] Handle 2 forms of NULL gues handle
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
|
|
|
|
|