All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] fix hypercall buffer locking in memory
@ 2018-06-18  7:18 Juergen Gross
  2018-06-18  7:18 ` [PATCH v2 1/3] tools/libxencall: use hypercall buffer device if available Juergen Gross
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Juergen Gross @ 2018-06-18  7:18 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, wei.liu2, ian.jackson

On Linux systems hypercall buffers in user memory are allocated with
MAP_LOCKED attribute. Unfortunately that doesn't mean that the buffer
will always be accessible by the hypervisor, as the kernel might set
the PTE for the buffer to invalid or read only for short periods of
time, e.g. due to page migration or compaction.

This results in highly sporadic -EFAULT for hypercalls issued by Xen
tools.

Fix this problem by using a new device node of the Linux privcmd driver
for allocating hypercall buffers.

Add a fallback in case the Linux kernel doesn't support that new device
node by repeating the getpageframeinfo3 hypercall which until now has
been the only one to be observed suffering from that problem.

This series is meant to be included in 4.11, so it can right away have
my:

Release-acked-by: Juergen Gross <jgross@suse.com>

Juergen Gross (3):
  tools/libxencall: use hypercall buffer device if available
  tools/libxencalls: add new function to query hypercall buffer safety
  tools/libxc: retry hypercall in case of EFAULT

 tools/libs/call/Makefile          |  2 +-
 tools/libs/call/core.c            | 12 +++++++-
 tools/libs/call/freebsd.c         |  5 ++++
 tools/libs/call/include/xencall.h |  7 +++++
 tools/libs/call/libxencall.map    |  5 ++++
 tools/libs/call/linux.c           | 63 ++++++++++++++++++++++++++++++++++-----
 tools/libs/call/minios.c          |  5 ++++
 tools/libs/call/netbsd.c          |  5 ++++
 tools/libs/call/private.h         |  7 ++++-
 tools/libs/call/solaris.c         |  5 ++++
 tools/libxc/xc_private.c          |  2 +-
 tools/libxc/xc_private.h          | 25 ++++++++++++++--
 12 files changed, 129 insertions(+), 14 deletions(-)

-- 
2.13.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2018-06-18 11:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18  7:18 [PATCH v2 0/3] fix hypercall buffer locking in memory Juergen Gross
2018-06-18  7:18 ` [PATCH v2 1/3] tools/libxencall: use hypercall buffer device if available Juergen Gross
2018-06-18 11:26   ` Ian Jackson
2018-06-18  7:18 ` [PATCH v2 2/3] tools/libxencalls: add new function to query hypercall buffer safety Juergen Gross
2018-06-18  7:18 ` [PATCH v2 3/3] tools/libxc: retry hypercall in case of EFAULT Juergen Gross
2018-06-18 11:26   ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.