[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9a57f554a2a969cbb54b95d5f4543334165ce33f.camel@intel.com>
Date: Tue, 16 Apr 2024 14:20:02 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "Yamahata, Isaku"
<isaku.yamahata@...el.com>
CC: "seanjc@...gle.com" <seanjc@...gle.com>, "Huang, Kai"
<kai.huang@...el.com>, "federico.parola@...ito.it"
<federico.parola@...ito.it>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "isaku.yamahata@...il.com"
<isaku.yamahata@...il.com>, "dmatlack@...gle.com" <dmatlack@...gle.com>,
"michael.roth@....com" <michael.roth@....com>, "pbonzini@...hat.com"
<pbonzini@...hat.com>
Subject: Re: [PATCH v2 02/10] KVM: Add KVM_MAP_MEMORY vcpu ioctl to
pre-populate guest memory
On Wed, 2024-04-10 at 15:07 -0700, isaku.yamahata@...el.com wrote:
> From: Isaku Yamahata <isaku.yamahata@...el.com>
>
> Add a new ioctl KVM_MAP_MEMORY in the KVM common code. It iterates on the
> memory range and calls the arch-specific function. Add stub arch function
> as a weak symbol.
>
> Suggested-by: Sean Christopherson <seanjc@...gle.com>
> Signed-off-by: Isaku Yamahata <isaku.yamahata@...el.com>
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@...el.com>
But one comment below.
> ---
> v2:
> - Drop need_resched(). (David, Sean, Kai)
> - Move cond_resched() at the end of loop. (Kai)
> - Drop added check. (David)
> - Use EINTR instead of ERESTART. (David, Sean)
> - Fix srcu lock leak. (Kai, Sean)
> - Add comment above copy_to_user().
> - Drop pointless comment. (Sean)
> - Drop kvm_arch_vcpu_pre_map_memory(). (Sean)
> - Don't overwrite error code. (Sean, David)
> - Make the parameter in bytes, not pages. (Michael)
> - Drop source member in struct kvm_memory_mapping. (Sean, Michael)
> ---
> include/linux/kvm_host.h | 3 +++
> include/uapi/linux/kvm.h | 9 +++++++
> virt/kvm/kvm_main.c | 54 ++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 66 insertions(+)
>
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index 48f31dcd318a..e56a0c7e5b42 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -2445,4 +2445,7 @@ static inline int kvm_gmem_get_pfn(struct kvm *kvm,
> }
> #endif /* CONFIG_KVM_PRIVATE_MEM */
>
> +int kvm_arch_vcpu_map_memory(struct kvm_vcpu *vcpu,
> + struct kvm_memory_mapping *mapping);
> +
> #endif
> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
> index 2190adbe3002..972aa9e054d3 100644
> --- a/include/uapi/linux/kvm.h
> +++ b/include/uapi/linux/kvm.h
> @@ -917,6 +917,7 @@ struct kvm_enable_cap {
> #define KVM_CAP_MEMORY_ATTRIBUTES 233
> #define KVM_CAP_GUEST_MEMFD 234
> #define KVM_CAP_VM_TYPES 235
> +#define KVM_CAP_MAP_MEMORY 236
This can go in a later patch.
Powered by blists - more mailing lists