lkml.org 
[lkml]   [2022]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v6 011/104] KVM: TDX: Initialize TDX module when loading kvm_intel.ko
On Fri, May 06, 2022 at 09:57:09PM +0800,
Xiaoyao Li <xiaoyao.li@intel.com> wrote:

> On 5/6/2022 2:14 AM, isaku.yamahata@intel.com wrote:
> > +int __init tdx_module_setup(void)
> > +{
> > + const struct tdsysinfo_struct *tdsysinfo;
> > + int ret = 0;
> > +
> > + BUILD_BUG_ON(sizeof(*tdsysinfo) != 1024);
> > + BUILD_BUG_ON(TDX_MAX_NR_CPUID_CONFIGS != 37);
> > +
> > + ret = tdx_detect();
> > + if (ret) {
> > + pr_info("Failed to detect TDX module.\n");
> > + return ret;
> > + }
> > +
> > + ret = tdx_init();
> > + if (ret) {
> > + pr_info("Failed to initialize TDX module.\n");
> > + return ret;
> > + }
> > +
> > + tdsysinfo = tdx_get_sysinfo();
> > + if (tdx_caps.nr_cpuid_configs > TDX_MAX_NR_CPUID_CONFIGS)
> > + return -EIO;
>
> It needs to check tdsysinfo->num_cpuid_config against
> TDX_MAX_NR_CPUID_CONFIG
>
> or move the check down after tdx_caps is initialized.

Thanks for catching it. I'll replace it with tdsysinfo->num_cpuid_config.

--
Isaku Yamahata <isaku.yamahata@gmail.com>

\
 
 \ /
  Last update: 2022-05-06 23:31    [W:0.977 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site