lkml.org 
[lkml]   [2022]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 13/14] KVM: Enable and expose KVM_MEM_PRIVATE
On Tue, Jul 19, 2022 at 11:55:24AM +0200, Gupta, Pankaj wrote:

...

> > @@ -4712,12 +4813,10 @@ static long kvm_vm_ioctl(struct file *filp,
> > (u32 __user *)(argp + offsetof(typeof(mem), flags))))
> > goto out;
> > - if (flags & KVM_MEM_PRIVATE) {
> > - r = -EINVAL;
> > - goto out;
> > - }
> > -
> > - size = sizeof(struct kvm_userspace_memory_region);
> > + if (flags & KVM_MEM_PRIVATE)
> > + size = sizeof(struct kvm_userspace_memory_region_ext);
>
> Not sure if we use kvm_userspace_memory_region_ext or kvm_user_mem_region,
> just for readability.

Somehow, but majorly for code maintainability, kvm_user_mem_region is
designed to be the alias of kvm_userspace_memory_region_ext so in the
code we can access the 'unpacked' fields using something like
'mem.usersapce_addr' instead of 'mem.region.userspace_addr'.

Chao
>
> > + else
> > + size = sizeof(struct kvm_userspace_memory_region);
> > if (copy_from_user(&mem, argp, size))
> > goto out;

\
 
 \ /
  Last update: 2022-07-19 16:33    [W:0.163 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site