Re: [PATCH v3 02/70] RAMBlock: Add support of KVM private guest memfd

David Hildenbrand
2023-11-15T17:55:04Z

On 15.11.23 08:14, Xiaoyao Li wrote:
> 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.
>
> 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.

Can you elaborate (and add to the patch description if there is good
reason) why we need that flag and why we cannot simply rely on the VM
type instead to decide whether to allocate a guest_memfd or not?

--
Cheers,

David / dhildenb