Xiaoyao Li 37662d85b0 HostMem: Add mechanism to opt in kvm guest memfd via MachineState
Add a new member "guest_memfd" to memory backends. When it's set
to true, it enables RAM_GUEST_MEMFD in ram_flags, thus private kvm
guest_memfd will be allocated during RAMBlock allocation.

Memory backend's @guest_memfd is wired with @require_guest_memfd
field of MachineState. It avoid looking up the machine in phymem.c.

MachineState::require_guest_memfd is supposed to be set by any VMs
that requires KVM guest memfd as private memory, e.g., TDX VM.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-ID: <20240320083945.991426-8-michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-04-23 17:35:25 +02:00
..
2023-12-29 11:17:30 +11:00
2024-04-18 11:17:28 +02:00
2024-03-25 14:19:42 +00:00
2024-02-27 09:37:13 +01:00
2023-12-29 11:17:30 +11:00
2023-12-29 11:17:30 +11:00
2024-04-18 11:17:28 +02:00
2023-12-30 07:38:06 +11:00
2024-04-18 11:17:27 +02:00
2024-03-19 11:56:37 +01:00
2023-12-30 07:38:06 +11:00
2024-03-12 21:32:31 +00:00
2024-02-01 08:13:30 +01:00
2024-02-01 08:13:30 +01:00