Re: [PATCH v4 08/12] KVM: selftests: Add guest_memfd based vm_mem_backing_src_types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2025-02-21 at 16:07 +0000, Patrick Roy wrote:

...

> @@ -985,10 +1013,13 @@ void vm_mem_add(struct kvm_vm *vm, enum vm_mem_backing_src_type src_type,
>  	if (alignment > 1)
>  		region->mmap_size += alignment;
>  
> -	region->fd = -1;
> -	if (backing_src_is_shared(src_type))
> +	if (backing_src_is_guest_memfd(src_type))
> +		region->fd = guest_memfd;
> +	else if (backing_src_is_guest_memfd(src_type))

Argh, this is nonsense. Should be 

+	else if (backing_src_is_shared(src_type))

instead.

>  		region->fd = kvm_memfd_alloc(region->mmap_size,
>  					     src_type == VM_MEM_SRC_SHARED_HUGETLB);
> +	else
> +		region->fd = -1;
>  
>  	region->mmap_start = mmap(NULL, region->mmap_size,
>  				  PROT_READ | PROT_WRITE,

...




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux