xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] tools/libxc: Avoid hypercalls for cacheflush on	x86
Date: Mon, 3 Mar 2014 16:19:58 +0000	[thread overview]
Message-ID: <5314ABAE.1050109@citrix.com> (raw)
In-Reply-To: <1393857478-14993-1-git-send-email-andrew.cooper3@citrix.com>

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@citrix.com>
> CC: Ian Campbell <Ian.Campbell@citrix.com>
> CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
> 
> ---
> 
> 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

  reply	other threads:[~2014-03-03 16:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03 14:37 [PATCH] tools/libxc: Avoid hypercalls for cacheflush on x86 Andrew Cooper
2014-03-03 16:19 ` David Vrabel [this message]
2014-03-03 16:22 ` Ian Jackson
2014-03-04  1:14   ` Ian Campbell
2014-03-04 11:22     ` Andrew Cooper
2014-03-11 11:31       ` Ian Campbell
2014-03-04  1:18   ` Ian Campbell
2014-03-04  9:24 ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5314ABAE.1050109@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).