qemu/accel/kvm
Xiaoyao Li 15f7a80c49 RAMBlock: Add support of KVM private guest memfd
Add KVM guest_memfd support to RAMBlock so both normal hva based memory
and kvm guest memfd based private memory can be associated in one RAMBlock.

Introduce new flag RAM_GUEST_MEMFD. When it's set, it calls KVM ioctl to
create private guest_memfd during RAMBlock setup.

Allocating a new RAM_GUEST_MEMFD flag to instruct the setup of guest memfd
is more flexible and extensible than simply relying on the VM type because
in the future we may have the case that not all the memory of a VM need
guest memfd. As a benefit, it also avoid getting MachineState in memory
subsystem.

Note, RAM_GUEST_MEMFD is supposed to be set for memory backends of
confidential guests, such as TDX VM. How and when to set it for memory
backends will be implemented in the following patches.

Introduce memory_region_has_guest_memfd() to query if the MemoryRegion has
KVM guest_memfd allocated.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-ID: <20240320083945.991426-7-michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-04-23 17:35:25 +02:00
..
kvm-accel-ops.c KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
kvm-all.c RAMBlock: Add support of KVM private guest memfd 2024-04-23 17:35:25 +02:00
kvm-cpus.h gdbstub: Use vaddr type for generic insert/remove_breakpoint() API 2023-02-27 22:29:01 +01:00
meson.build target/i386/kvm: Restrict SEV stubs to x86 architecture 2021-10-13 10:47:49 +02:00
trace-events trace/kvm: Split address space and slot id in trace_kvm_set_user_memory() 2024-04-23 17:35:25 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00