qemu/backends
Igor Mammedov 70b6d525df hostmem: don't use mbind() if host-nodes is empty
Since 5.0 QEMU uses hostmem backend for allocating main guest RAM.
The backend however calls mbind() which is typically NOP
in case of default policy/absent host-nodes bitmap.
However when runing in container with black-listed mbind()
syscall, QEMU fails to start with error
 "cannot bind memory to host NUMA nodes: Operation not permitted"
even when user hasn't provided host-nodes to pin to explictly
(which is the case with -m option)

To fix issue, call mbind() only in case when user has provided
host-nodes explicitly (i.e. host_nodes bitmap is not empty).
That should allow to run QEMU in containers with black-listed
mbind() without memory pinning. If QEMU provided memory-pinning
is required user still has to white-list mbind() in container
configuration.

Reported-by: Manuel Hohmann <mhohmann@physnet.uni-hamburg.de>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20200430154606.6421-1-imammedo@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-05-12 12:48:57 -04:00
..
cryptodev-builtin.c cryptodev: Fix cryptodev_builtin_cleanup() error API violation 2020-04-29 08:01:52 +02:00
cryptodev-vhost-user.c chardev: Use QEMUChrEvent enum in IOEventHandler typedef 2020-01-08 11:15:35 +01:00
cryptodev-vhost.c cryptodev: add vhost support 2018-03-01 18:26:17 +02:00
cryptodev.c backends/cryptodev: drop local_err from cryptodev_backend_complete() 2019-12-18 08:43:19 +01:00
dbus-vmstate.c migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
hostmem-file.c hostmem: fix strict bind policy 2020-02-19 16:50:02 +00:00
hostmem-memfd.c hostmem: fix strict bind policy 2020-02-19 16:50:02 +00:00
hostmem-ram.c machine: alias -mem-path and -mem-prealloc into memory-foo backend 2020-02-19 16:49:53 +00:00
hostmem.c hostmem: don't use mbind() if host-nodes is empty 2020-05-12 12:48:57 -04:00
Makefile.objs Add dbus-vmstate object 2020-01-06 18:41:32 +04:00
rng-builtin.c virtio-rng: change default backend to rng-builtin 2019-09-04 06:32:51 -04:00
rng-egd.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
rng-random.c VirtIO-RNG: Update default entropy source to /dev/urandom 2019-07-03 17:23:39 +02:00
rng.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
tpm.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
trace-events Add dbus-vmstate object 2020-01-06 18:41:32 +04:00
vhost-user.c backends/vhost-user.c: prevent using uninitialized vqs 2019-09-16 06:27:35 -04:00