Re: [PATCH v13 019/113] KVM: TDX: create/destroy VM structure

From: Isaku Yamahata
Date: Sun May 28 2023 - 04:24:15 EST


On Tue, May 23, 2023 at 04:17:07PM +0800,
"Wen, Qian" <qian.wen@xxxxxxxxx> wrote:

> > diff --git a/arch/x86/kvm/vmx/x86_ops.h b/arch/x86/kvm/vmx/x86_ops.h
> > index 8118647aa8ca..8f87eeeab97c 100644
> > --- a/arch/x86/kvm/vmx/x86_ops.h
> > +++ b/arch/x86/kvm/vmx/x86_ops.h
> > @@ -139,19 +139,28 @@ void vmx_setup_mce(struct kvm_vcpu *vcpu);
> >
> > #ifdef CONFIG_INTEL_TDX_HOST
> > int __init tdx_hardware_setup(struct kvm_x86_ops *x86_ops);
> > +void tdx_hardware_unsetup(void);
> > int tdx_hardware_enable(void);
> > bool tdx_is_vm_type_supported(unsigned long type);
> > int tdx_dev_ioctl(void __user *argp);
> >
> > int tdx_vm_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap);
> > +int tdx_vm_init(struct kvm *kvm);
> > +void tdx_mmu_release_hkid(struct kvm *kvm);
> > +void tdx_vm_free(struct kvm *kvm);
> > int tdx_vm_ioctl(struct kvm *kvm, void __user *argp);
> > #else
> > static inline int tdx_hardware_setup(struct kvm_x86_ops *x86_ops) { return -ENOSYS; }
> > +static inline void tdx_hardware_unsetup(void) {}
> > static inline int tdx_hardware_enable(void) { return -EOPNOTSUPP; }
> > static inline bool tdx_is_vm_type_supported(unsigned long type) { return false; }
> > static inline int tdx_dev_ioctl(void __user *argp) { return -EOPNOTSUPP; };
> >
> > static inline int tdx_vm_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap) { return -EINVAL; };
> > +static inline int tdx_vm_init(struct kvm *kvm) { return -EOPNOTSUPP; }
> > +static inline void tdx_mmu_release_hkid(struct kvm *kvm) {}
> > +static inline void tdx_flush_shadow_all_private(struct kvm *kvm) {}
>
> typo? This function tdx_flush_shadow_all_private is not used anywhere.

Right. It was carry over from the old versions. Will remove the line.

Thanks,
--
Isaku Yamahata <isaku.yamahata@xxxxxxxxx>