[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 13/14] KVM: Enable and expose KVM_MEM_PRIVATE
From: |
Chao Peng |
Subject: |
Re: [PATCH v7 13/14] KVM: Enable and expose KVM_MEM_PRIVATE |
Date: |
Tue, 19 Jul 2022 22:12:43 +0800 |
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;
- Re: [PATCH v7 07/14] KVM: Use gfn instead of hva for mmu_notifier_retry, (continued)
- [PATCH v7 09/14] KVM: Extend the memslot to support fd-based private memory, Chao Peng, 2022/07/06
- [PATCH v7 10/14] KVM: Add KVM_EXIT_MEMORY_FAULT exit, Chao Peng, 2022/07/06
- [PATCH v7 12/14] KVM: Handle page fault for private memory, Chao Peng, 2022/07/06
- [PATCH v7 13/14] KVM: Enable and expose KVM_MEM_PRIVATE, Chao Peng, 2022/07/06
- [PATCH v7 14/14] memfd_create.2: Describe MFD_INACCESSIBLE flag, Chao Peng, 2022/07/06
- Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory, Gupta, Pankaj, 2022/07/12
- Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory, Chao Peng, 2022/07/13
- Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory, Gupta, Pankaj, 2022/07/13
- Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory, Chao Peng, 2022/07/13
- Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory, Gupta, Pankaj, 2022/07/14
- Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory, Gupta, Pankaj, 2022/07/14
- Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory, Andy Lutomirski, 2022/07/14
- Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory, Gupta, Pankaj, 2022/07/14