Skip to content

fix hypercall buffer locking in memory

Juergen Gross xen-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 2 repliesIn review
  2. v13 patches 10 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3tools/libxencall: use hypercall buffer device if availabletools/libs/call/core.c tools/libs/call/linux.c tools/libs/call/private.h+68 -91 reply
2/3tools/libxencalls: add new function to query hypercall buffer safetytools/libs/call/Makefile tools/libs/call/freebsd.c tools/libs/call/include/xencall.h +5 more+38 -10 replies
3/3tools/libxc: retry hypercall in case of EFAULTtools/libxc/xc_private.c tools/libxc/xc_private.h+23 -41 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchJuergen GrossIan Jackson
SeriesRelease-acked-by
1/3A-b
2/3A-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] fix hypercall buffer locking in memory

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:

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(-)
Signature · 7 lines
2.13.7


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel