qemu/backends
Stefano Garzarella 4e647fa085 hostmem: add a new memory backend based on POSIX shm_open()
shm_open() creates and opens a new POSIX shared memory object.
A POSIX shared memory object allows creating memory backend with an
associated file descriptor that can be shared with external processes
(e.g. vhost-user).

The new `memory-backend-shm` can be used as an alternative when
`memory-backend-memfd` is not available (Linux only), since shm_open()
should be provided by any POSIX-compliant operating system.

This backend mimics memfd, allocating memory that is practically
anonymous. In theory shm_open() requires a name, but this is allocated
for a short time interval and shm_unlink() is called right after
shm_open(). After that, only fd is shared with external processes
(e.g., vhost-user) as if it were associated with anonymous memory.

In the future we may also allow the user to specify the name to be
passed to shm_open(), but for now we keep the backend simple, mimicking
anonymous memory such as memfd.

Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com> (QAPI schema)
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20240618100519.145853-1-sgarzare@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2024-07-03 18:14:06 -04:00
..
tpm backends/tpm: Remove newline character in trace event 2024-06-10 13:05:27 -04:00
confidential-guest-support.c
cryptodev-builtin.c backends/cryptodev-builtin: Fix local_error leaks 2024-04-29 15:26:39 +03:00
cryptodev-hmp-cmds.c hmp: add cryptodev info command 2023-03-07 12:38:59 -05:00
cryptodev-lkcf.c cryptodev: Use CryptoDevBackendOpInfo for operation 2023-03-07 12:38:59 -05:00
cryptodev-vhost-user.c cryptodev-vhost-user: add asymmetric crypto support 2023-06-23 02:54:44 -04:00
cryptodev-vhost.c cryptodev: Introduce cryptodev.json 2023-03-07 12:38:59 -05:00
cryptodev.c backends/cryptodev: Do not ignore throttle/backends Errors 2024-01-19 12:28:59 +01:00
dbus-vmstate1.xml docs: move D-Bus VMState documentation to source XML 2021-12-21 10:50:21 +04:00
dbus-vmstate.c backends: Constify VMState 2023-12-30 07:38:06 +11:00
host_iommu_device.c backends: Introduce HostIOMMUDevice abstract 2024-06-24 23:15:30 +02:00
hostmem-epc.c backends/hostmem: Report error when memory size is unaligned 2024-06-08 10:33:38 +02:00
hostmem-file.c backends/hostmem: Report error when memory size is unaligned 2024-06-08 10:33:38 +02:00
hostmem-memfd.c backends/hostmem: Report error when memory size is unaligned 2024-06-08 10:33:38 +02:00
hostmem-ram.c HostMem: Add mechanism to opt in kvm guest memfd via MachineState 2024-04-23 17:35:25 +02:00
hostmem-shm.c hostmem: add a new memory backend based on POSIX shm_open() 2024-07-03 18:14:06 -04:00
hostmem.c hostmem: simplify the code for merge and dump properties 2024-06-08 10:33:38 +02:00
iommufd.c backends/iommufd: Implement HostIOMMUDeviceClass::get_cap() handler 2024-06-24 23:15:30 +02:00
Kconfig backends/iommufd: Introduce the iommufd object 2023-12-19 19:03:38 +01:00
meson.build hostmem: add a new memory backend based on POSIX shm_open() 2024-07-03 18:14:06 -04:00
rng-builtin.c
rng-egd.c backends: Improve error messages when property can no longer be set 2022-10-27 07:56:56 +02:00
rng-random.c backends: Improve error messages when property can no longer be set 2022-10-27 07:56:56 +02:00
rng.c error: Drop superfluous #include "qapi/qmp/qerror.h" 2023-02-23 13:56:14 +01:00
trace-events backends/iommufd: Make iommufd_backend_*() return bool 2024-05-16 16:59:20 +02:00
trace.h
vhost-user.c backends/vhost-user: remove the ioeventfd check 2023-03-02 03:10:47 -05:00