Re: [PATCH 5/6] KVM: x86: Remove WARN_ON in kvm_arch_check_processor_compat

From: Sean Christopherson
Date: Tue Jan 18 2022 - 19:34:33 EST


On Mon, Jan 17, 2022, Chao Gao wrote:
> On Mon, Jan 17, 2022 at 09:35:04PM +0800, Chao Gao wrote:
> >OK. How about:
> >
> > /*
> > * Compatibility checks are done when loading KVM or in KVM's CPU
> > * hotplug callback. It ensures all online CPUs are compatible before
> > * running any vCPUs. For other cases, compatibility checks are
> > * unnecessary or even problematic. Try to detect improper usages here.
> > */
> > WARN_ON(!irqs_disabled() && !cpu_active(smp_processor_id()));
>
> Sorry. It should be:
> WARN_ON(!irqs_disabled() && cpu_active(smp_processor_id()));

Nice! That's exactly what I was hoping we could do.