xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/libxc: Avoid hypercalls for cacheflush on x86
@ 2014-03-03 14:37 Andrew Cooper
  2014-03-03 16:19 ` David Vrabel
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andrew Cooper @ 2014-03-03 14:37 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Ian Jackson, Ian Campbell

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
 }
 
 int xc_domain_pause(xc_interface *xch,
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-03-11 11:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-03 14:37 [PATCH] tools/libxc: Avoid hypercalls for cacheflush on x86 Andrew Cooper
2014-03-03 16:19 ` David Vrabel
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

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).