xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/2] xen/privcmd: prevent page migration for hypercall buffers
@ 2016-08-04 15:16 David Vrabel
  2016-08-04 15:16 ` [PATCHv2 1/2] xen/prvicmd: use ENOTTY if the IOCTL is not supported David Vrabel
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: David Vrabel @ 2016-08-04 15:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, Boris Ostrovsky, David Vrabel

Currently libxencall using mlocked buffers for hypercall buffers.
This pages are subject to compaction and page migration. A userspace
process may see a hypercall fail with -EFAULT if a page backing a
hypercall buffer is in the process of being migrated.

Page migration can be prevented by taking an additional reference to
the page.

There are three possible ways to do this:

1. Add a new device which when mmap()'d populated the VMA with
   suitable memory that has an additional reference.  This would give
   VMAs that have appropriate properties set (e.g., VM_DONTCOPY)
   without having to do additional madvise() calls.

2. Add a new ioctl to privcmd to populate a VMA with suitably
   ref-counted pages.  However, mmap() on privcmd is already used for
   foreign mappings and the VMA properties for hypercall buffers and
   foreign mappings might need to be different and the handling of
   unmap will need to be different.  This might be tricky.

3. Add a pair of ioctls to privcmd to lock/unlock a buffer by
   getting/putting an additional reference to the page.  This is
   what's implemented in this series.

Any thoughts on which is the best approach?

Changes in v2:
- Addressed Jan's feedback for #2 (see patch for details).

David


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

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

end of thread, other threads:[~2016-10-10 13:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-04 15:16 [PATCHv2 0/2] xen/privcmd: prevent page migration for hypercall buffers David Vrabel
2016-08-04 15:16 ` [PATCHv2 1/2] xen/prvicmd: use ENOTTY if the IOCTL is not supported David Vrabel
2016-08-08 10:35   ` Juergen Gross
2016-08-04 15:16 ` [PATCHv2 2/2] xen/privcmd: add ioctls for locking/unlocking hypercall buffers David Vrabel
2016-08-04 16:02   ` Jan Beulich
2016-08-22 17:24     ` David Vrabel
2016-08-23  8:46       ` Jan Beulich
2016-08-23  8:54         ` Andrew Cooper
2016-08-22 17:25 ` [PATCHv2 0/2] xen/privcmd: prevent page migration for " David Vrabel
2016-08-25  5:41   ` Juergen Gross
2016-10-10 13:45 ` David Vrabel

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