| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH XEN v5 09/23] tools: Refactor hypercall calling wrappers into libxencall.
 Ian Campbell writes ("[PATCH XEN v5 09/23] tools: Refactor hypercall calling 
wrappers into libxencall."):
> libxencall will provide a stable API and ABI for calling hypercalls
> (although those hypercalls themselves may not have a stable API). As
> well as the hypercall buffer infrastructure needed in order to safely
> provide pointer arguments to hypercalls.
...
> +/*
> + * This library allows you to make arbitrary hypercalls (subject to
> + * sufficient permission for the process and the domain itself). Note
> + * that while the library interface is stable the hypercalls are
> + * subject to their own rules.
Something needs to say what the error handling is like.
Do these functions set errno ?
> +/*
> + * Call hypercalls with varying numbers of arguments.
> + */
> +int xencall0(xencall_handle *xcall, unsigned int op);
Is the return value the raw hypercall return value, or is hypervisor
do_foo returning -EFOOBAR turned into to -1/errno=EFOOBAR ?
(Hopefully the answer to this doesn't depend on the hypercall ABI...)
> +/*
> + * Allocate and free memory which is suitable for use as a pointer
> + * argument to a hypercall.
> + */
> +void *xencall_alloc_buffer_pages(xencall_handle *xcall, int nr_pages);
> +void xencall_free_buffer_pages(xencall_handle *xcall, void *p, int nr_pages);
> +
> +void *xencall_alloc_buffer(xencall_handle *xcall, size_t size);
> +void xencall_free_buffer(xencall_handle *xcall, void *p);
See above re error handling.
Can these functions be used without (a) knowing the page size
(b) a rounding macro ?
It would be best to save callers the trouble of providing those
themselves.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
 
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |