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

Re: [Xen-devel] [PATCH 2 of 8] Tools: Update libxc mem sharing interface



On Fri, 2011-12-09 at 23:15 +0000, Andres Lagar-Cavilla wrote:
> tools/libxc/xc_memshr.c |  19 ++++++++++++++++++-
>  tools/libxc/xenctrl.h   |   7 ++++++-
>  2 files changed, 24 insertions(+), 2 deletions(-)
> 
> 
> Previosuly, the mem sharing code would return an opaque handle
> to index shared pages (and nominees) in its global hash table.
> By removing the hash table, the handle becomes a version, to
> avoid sharing a stale version of a page. Thus, libxc wrappers
> need to be updated accordingly.

Same comment wrt breaking the build as the previous patch.

> 
> Signed-off-by: Adin Scannell <adin@xxxxxxxxxxx>
> Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
> 
> diff -r 6f58de995103 -r 892049dfc1c9 tools/libxc/xc_memshr.c
> --- a/tools/libxc/xc_memshr.c
> +++ b/tools/libxc/xc_memshr.c
> @@ -88,8 +88,13 @@ int xc_memshr_nominate_gref(xc_interface
>  
>  int xc_memshr_share(xc_interface *xch,
>                      uint32_t source_domain,
> +                    uint64_t source_gfn,
>                      uint64_t source_handle,
> -                    uint64_t client_handle)
> +                    int source_is_gref,
> +                    uint32_t client_domain,
> +                    uint64_t client_gfn,
> +                    uint64_t client_handle,
> +                    int client_is_gref)
>  {
>      DECLARE_DOMCTL;
>      struct xen_domctl_mem_sharing_op *op;
> @@ -100,8 +105,20 @@ int xc_memshr_share(xc_interface *xch,
>      op = &(domctl.u.mem_sharing_op);
>      op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_SHARE;
>      op->u.share.source_handle = source_handle;
> +    op->u.share.client_domain = (uint64_t) client_domain;

Why this disconnect between xc and hypercall API? 

>      op->u.share.client_handle = client_handle;
>  
> +    if (source_is_gref)
> +        XEN_DOMCTL_MEM_SHARING_FIELD_MAKE_GREF(

Is there an outstanding patch somewhere which adds this macro? I don't
see it in staging/xen-unstable.hg. Ah, yes, found it in another mail:

+#define XEN_DOMCTL_MEM_SHARING_FIELD_MAKE_GREF(field, val)  \
+    (field) = (XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG | val)

Since this just adds a flag to the gfn why not just expose that to the
caller of this function rather than adding a separate flag as a
parameter?

> +                op->u.share.source_gfn, source_gfn);
> +    else
> +        op->u.share.source_gfn = source_gfn;
> +    if (client_is_gref)
> +        XEN_DOMCTL_MEM_SHARING_FIELD_MAKE_GREF(
> +                op->u.share.client_gfn, client_gfn);
> +    else
> +        op->u.share.client_gfn = client_gfn;
> +
>      return do_domctl(xch, &domctl);
>  }
>  
> diff -r 6f58de995103 -r 892049dfc1c9 tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h
> +++ b/tools/libxc/xenctrl.h
> @@ -1893,8 +1893,13 @@ int xc_memshr_nominate_gref(xc_interface
>                              uint64_t *handle);
>  int xc_memshr_share(xc_interface *xch,
>                      uint32_t source_domain,
> +                    uint64_t source_gfn,
>                      uint64_t source_handle,
> -                    uint64_t client_handle);
> +                    int source_is_gref,
> +                    uint32_t client_domain,
> +                    uint64_t client_gfn,
> +                    uint64_t client_handle,
> +                    int dest_is_gref);
>  int xc_memshr_domain_resume(xc_interface *xch,
>                              uint32_t domid);
>  int xc_memshr_debug_gfn(xc_interface *xch,



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


 


Rackspace

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