[RFC PATCH v1 0/8] liveupdate: kvm: Guest_memfd preservation

Sean Christopherson seanjc at google.com
Fri May 29 06:57:41 PDT 2026


On Thu, May 28, 2026, tarunsahu at google.com wrote:
> 3. No need to preserve kvm->mem_attr_array, as this is on deprecating
>    path and For this series, where only fully shared guest_memfd is
>    supported for liveupdate, preservation of these attributes not
>    required.
> 
> Due to time constraints:
> we have one open Question left:
> 1. How to check guest_memfd is fully shared. Currently that is being
>    done by INIT_SHARED flag. But with in-place it is going to change
>    its meaning and it will mean only durng the creation of guest_memfd
>    it is shared whose folios can be converted to private.
>    So for this series, I am looking for suggestion, what is the best way
>    to find the sharedness of guest_memfd which will be compatible with
>    in-place series. OR we can go like this (my personnel recommendation):
> 
>    if (guest_memfd_is_fully_shared())
>       return true; // support the preservation
> 
>    // This series
>    int guest_memfd_is_fully_shared(void) {
>        if (guest_memfd->flags & GUEST_MEMFD_FLAG_INIT_SHARED)
>           return true;
>          return false;
>    }
> 
>    TO::
>    // Once in-place conversion series lands.
>    int guest_memfd_is_fully_shared(void) {
>        if (No Private flags in (guest_memfd->attributes))
>           return true;
>          return false;
>    }

Given that lack of support isn't going to be limited to _just_ guest_memfd,
simply disallow preservation if the VM supports private memory:

	if (kvm_arch_has_private_mem(kvm))
		return -EOPNOTSUPP;



More information about the kexec mailing list