qemu-e2k/util
Peter Xu c40c046341 util/userfaultfd: Support /dev/userfaultfd
Teach QEMU to use /dev/userfaultfd when it existed and fallback to the
system call if either it's not there or doesn't have enough permission.

Firstly, as long as the app has permission to access /dev/userfaultfd, it
always have the ability to trap kernel faults which QEMU mostly wants.
Meanwhile, in some context (e.g. containers) the userfaultfd syscall can be
forbidden, so it can be the major way to use postcopy in a restricted
environment with strict seccomp setup.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2023-02-11 16:51:09 +01:00
..
aio-posix.c util/aio: Defer disabling poll mode as long as possible 2023-01-23 15:01:22 -05:00
aio-posix.h
aio-wait.c
aio-win32.c util/aio-win32: Correct the event array size in aio_poll() 2022-11-06 09:48:26 +01:00
aiocb.c
async-teardown.c Fix non-first inclusions of qemu/osdep.h 2023-02-08 07:28:05 +01:00
async.c coroutine: Use Coroutine typedef name instead of structure tag 2023-01-20 07:23:45 +01:00
atomic64.c
base64.c
bitmap.c migration: Use non-atomic ops for clear log bitmap 2022-11-21 11:58:10 +01:00
bitops.c
block-helpers.c
block-helpers.h
buffer.c
bufferiszero.c util/bufferiszero: Use __attribute__((target)) for avx2/avx512 2023-01-16 10:14:12 -10:00
cacheflush.c
compatfd.c
coroutine-sigaltstack.c
coroutine-ucontext.c
coroutine-win32.c
crc32c.c
crc-ccitt.c
cutils.c util: remove support for hex numbers with a scaling suffix 2023-01-06 00:51:02 +01:00
dbus.c
drm.c
envlist.c
error-report.c util/error: add G_GNUC_PRINTF for various functions 2023-01-11 10:44:34 +01:00
error.c util/error: add G_GNUC_PRINTF for various functions 2023-01-11 10:44:34 +01:00
event_notifier-posix.c
event_notifier-win32.c
fdmon-epoll.c
fdmon-io_uring.c
fdmon-poll.c
fifo8.c
filemonitor-inotify.c
filemonitor-stub.c
getauxval.c
guest-random.c
hbitmap.c
hexdump.c
host-utils.c
id.c
int128.c include/qemu/int128: Use Int128 structure for TCI 2023-02-04 06:19:42 -10:00
interval-tree.c util: Add interval-tree.c 2022-12-20 17:09:41 -08:00
iov.c util: make do_send_recv work with partial send/recv 2022-10-12 19:22:01 +04:00
iova-tree.c
keyval.c
lockcnt.c
log.c util/log: Always send errors to logfile when daemonized 2023-01-06 00:50:32 +01:00
main-loop.c Don't include headers already included by qemu/osdep.h 2023-02-08 07:28:05 +01:00
memalign.c
memfd.c
meson.build accel: introduce accelerator blocker API 2023-01-11 09:59:39 +01:00
mmap-alloc.c
module.c module: add Error arguments to module_load and module_load_qom 2022-11-06 09:48:50 +01:00
notify.c
nvdimm-utils.c
osdep.c error handling: Use RETRY_ON_EINTR() macro where applicable 2023-01-09 13:50:47 +01:00
oslib-posix.c Drop duplicate #include 2023-02-08 07:28:05 +01:00
oslib-win32.c util/oslib-win32: Remove obsolete reference to g_poll code 2022-12-15 15:19:24 +01:00
path.c
qdist.c
qemu-co-shared-resource.c
qemu-co-timeout.c
qemu-config.c util/qemu-config: Fix "query-command-line-options" to provide the right values 2022-12-15 15:19:23 +01:00
qemu-coroutine-io.c
qemu-coroutine-lock.c coroutine: Clean up superfluous inclusion of qemu/coroutine.h 2023-01-19 10:18:28 +01:00
qemu-coroutine-sleep.c coroutine: Clean up superfluous inclusion of qemu/coroutine.h 2023-01-19 10:18:28 +01:00
qemu-coroutine.c coroutine: Clean up superfluous inclusion of qemu/coroutine.h 2023-01-19 10:18:28 +01:00
qemu-option.c
qemu-print.c
qemu-progress.c
qemu-sockets.c sockets: Use ERRP_GUARD() where obviously appropriate 2022-12-14 16:19:35 +01:00
qemu-thread-common.h
qemu-thread-posix.c util: Introduce qemu_thread_set_affinity() and qemu_thread_get_affinity() 2022-10-27 11:00:36 +02:00
qemu-thread-win32.c util: Introduce qemu_thread_set_affinity() and qemu_thread_get_affinity() 2022-10-27 11:00:36 +02:00
qemu-timer-common.c
qemu-timer.c
qht.c util/qht: use striped locks under TSAN 2023-02-02 11:48:20 +00:00
qsp.c
range.c
rcu.c
readline.c readline: Extract readline_add_completion_of() from monitor 2023-02-04 07:56:54 +01:00
selfmap.c
stats64.c
sys_membarrier.c
systemd.c
thread-context.c qapi: Use returned bool to check for failure (again) 2022-12-14 16:19:35 +01:00
thread-pool.c
throttle.c
timed-average.c
trace-events util/userfaultfd: Support /dev/userfaultfd 2023-02-11 16:51:09 +01:00
trace.h
transactions.c
unicode.c
uri.c
userfaultfd.c util/userfaultfd: Support /dev/userfaultfd 2023-02-11 16:51:09 +01:00
uuid.c
vfio-helpers.c error handling: Use RETRY_ON_EINTR() macro where applicable 2023-01-09 13:50:47 +01:00
vhost-user-server.c io: Add support for MSG_PEEK for socket channel 2023-02-06 19:22:56 +01:00
yank.c