Re: [PATCH v3 06/49] RAMBlock: Add support of KVM private guest memfd

2024-03-20 Thread Paolo Bonzini
On 3/20/24 09:39, Michael Roth wrote: @@ -1842,6 +1842,17 @@ static void ram_block_add(RAMBlock *new_block, Error **errp) } } +if (kvm_enabled() && (new_block->flags & RAM_GUEST_MEMFD)) { +assert(new_block->guest_memfd < 0); + +new_block->guest_memfd = kvm

[PATCH v3 06/49] RAMBlock: Add support of KVM private guest memfd

2024-03-20 Thread Michael Roth
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