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

Re: [Xen-devel] [PATCH] tools/libxc: Avoid hypercalls for cacheflush on x86



On 03/03/14 14:37, Andrew Cooper wrote:
> XEN_DOMCTL_cacheflush hypercalls are -ENOSYS on x86.  As domain
> creation/migration is already very hypercall-heavy, avoid making extra
> redundant hypercalls
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
> CC: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
> 
> ---
> 
> Discovered when running valgrind against XenServer trunk, which is now 4.4
> based.
> ---
>  tools/libxc/xc_domain.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
> index 369c3f3..b9cc1db 100644
> --- a/tools/libxc/xc_domain.c
> +++ b/tools/libxc/xc_domain.c
> @@ -51,12 +51,18 @@ int xc_domain_create(xc_interface *xch,
>  int xc_domain_cacheflush(xc_interface *xch, uint32_t domid,
>                           xen_pfn_t start_pfn, xen_pfn_t nr_pfns)
>  {
> +#if defined (__i386__) || defined (__x86_64__)
> +    /* This is not implemented or needed for x86.  Avoid repeatedly going to
> +     * Xen to find -ENOSYS. */
> +    return -ENOSYS;
> +#else
>      DECLARE_DOMCTL;
>      domctl.cmd = XEN_DOMCTL_cacheflush;
>      domctl.domain = (domid_t)domid;
>      domctl.u.cacheflush.start_pfn = start_pfn;
>      domctl.u.cacheflush.nr_pfns = nr_pfns;
>      return do_domctl(xch, &domctl);
> +#endif

Rather than icky #ifdef's I suggest caching the result of any -ENOSYS
return value.

David

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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