[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9a70ba15eaa44fbaf39b7d392df978ebe7640574.camel@intel.com>
Date: Wed, 15 Mar 2023 10:35:20 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "isaku.yamahata@...il.com" <isaku.yamahata@...il.com>
CC: "Christopherson,, Sean" <seanjc@...gle.com>,
"Shahar, Sagi" <sagis@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Aktas, Erdem" <erdemaktas@...gle.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"zhi.wang.linux@...il.com" <zhi.wang.linux@...il.com>,
"dmatlack@...gle.com" <dmatlack@...gle.com>,
"Yamahata, Isaku" <isaku.yamahata@...el.com>
Subject: Re: [PATCH v13 003/113] KVM: TDX: Initialize the TDX module when
loading the KVM intel kernel module
>
> > +static bool enable_tdx __ro_after_init;
> > +module_param_named(tdx, enable_tdx, bool, 0444);
> > +
> > +static __init int vt_hardware_setup(void)
> > +{
> > + int ret;
> > +
> > + ret = vmx_hardware_setup();
> > + if (ret)
> > + return ret;
> > +
> > + enable_tdx = enable_tdx && !tdx_hardware_setup(&vt_x86_ops);
>
> Unfortunately, the enable_tdx should also be protected by the
> cpus_read_lock(),
> because CPU hotplug code path checks it too (as seen in your next patch).
Sorry I was wrong. I forgot the CPU hotplug callbacks are registered in
kvm_init(), which happens after hardware_setup(), so the CPU hotplug code cannot
race with this hardware_setup() code here.
[...]
>
> I think you can merge next patch with this one because they are kinda related.
>
>
> Putting them together allows people to review more easily.
And perhaps this isn't necessary either.
Powered by blists - more mailing lists