lkml.org 
[lkml]   [2022]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 022/103] KVM: TDX: Add place holder for TDX VM specific mem_enc_op ioctl
On Mon, Aug 29, 2022 at 12:07:55PM +0800,
Binbin Wu <binbin.wu@linux.intel.com> wrote:

> > diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c
> > index 7b497ed1f21c..067f5de56c53 100644
> > --- a/arch/x86/kvm/vmx/main.c
> > +++ b/arch/x86/kvm/vmx/main.c
> > @@ -73,6 +73,14 @@ static void vt_vm_free(struct kvm *kvm)
> > return tdx_vm_free(kvm);
> > }
> > +static int vt_mem_enc_ioctl(struct kvm *kvm, void __user *argp)
> > +{
> > + if (!is_td(kvm))
> > + return -ENOTTY;
> > +
> > + return tdx_vm_ioctl(kvm, argp);
> > +}
> > +
> > struct kvm_x86_ops vt_x86_ops __initdata = {
> > .name = "kvm_intel",
> > @@ -214,6 +222,7 @@ struct kvm_x86_ops vt_x86_ops __initdata = {
> > .vcpu_deliver_sipi_vector = kvm_vcpu_deliver_sipi_vector,
> > .dev_mem_enc_ioctl = tdx_dev_ioctl,
> > + .mem_enc_ioctl = vt_mem_enc_ioctl,
>
> suggeust to align the interafce/function name style with the scop.
>
> patch 21 and 27 have the scope in interafce names(dev / vcpu), may be
> clearer to use  vcpu_mem_enc_ioctl?

This is a matter of preference. I intentionally chose to drop mem_enc part
because actually KVM_MEMORY_ENCRYPT_OP is abused for TDX or SEV(-SNP) specific
operation. Subcommand for KVM_MEMORY_ENCRYPT_OP is not directly related to
memory encryption. It should be KVM_CONFIDENTIAL_OP or something.
Unfortunately it's too late to rename it.
--
Isaku Yamahata <isaku.yamahata@gmail.com>

\
 
 \ /
  Last update: 2022-08-29 21:18    [W:0.127 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site