lkml.org 
[lkml]   [2023]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v13 003/113] KVM: TDX: Initialize the TDX module when loading the KVM intel kernel module
Date
> 
> > +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.

\
 
 \ /
  Last update: 2023-03-27 01:01    [W:1.391 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site