Commit de01e0d3 authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

lazy-pages: request userfaultfd events during API handshake

travis-ci: success for lazy-pages: add non-#PF events handling (rev2)
Signed-off-by: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 371947c1
...@@ -49,6 +49,12 @@ ...@@ -49,6 +49,12 @@
#define lp_err(lpi, fmt, arg...) pr_err("%d-%d: " fmt, lpi->pid, lpi->lpfd.fd, ##arg) #define lp_err(lpi, fmt, arg...) pr_err("%d-%d: " fmt, lpi->pid, lpi->lpfd.fd, ##arg)
#define lp_perror(lpi, fmt, arg...) pr_perror("%d-%d: " fmt, lpi->pid, lpi->lpfd.fd, ##arg) #define lp_perror(lpi, fmt, arg...) pr_perror("%d-%d: " fmt, lpi->pid, lpi->lpfd.fd, ##arg)
#define NEED_UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK | \
UFFD_FEATURE_EVENT_EXIT | \
UFFD_FEATURE_EVENT_REMAP | \
UFFD_FEATURE_EVENT_UNMAP | \
UFFD_FEATURE_EVENT_REMOVE)
#define LAZY_PAGES_SOCK_NAME "lazy-pages.socket" #define LAZY_PAGES_SOCK_NAME "lazy-pages.socket"
static mutex_t *lazy_sock_mutex; static mutex_t *lazy_sock_mutex;
...@@ -229,7 +235,7 @@ int setup_uffd(int pid, struct task_restore_args *task_args) ...@@ -229,7 +235,7 @@ int setup_uffd(int pid, struct task_restore_args *task_args)
* Check if the UFFD_API is the one which is expected * Check if the UFFD_API is the one which is expected
*/ */
uffdio_api.api = UFFD_API; uffdio_api.api = UFFD_API;
uffdio_api.features = 0; uffdio_api.features = kdat.uffd_features & NEED_UFFD_API_FEATURES;
if (ioctl(task_args->uffd, UFFDIO_API, &uffdio_api)) { if (ioctl(task_args->uffd, UFFDIO_API, &uffdio_api)) {
pr_err("Checking for UFFDIO_API failed.\n"); pr_err("Checking for UFFDIO_API failed.\n");
goto err; goto err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment