Re: [PATCH v4 10/26] KVM: Drop kvm_count_lock and instead protect kvm_usage_count with kvm_lock

From: Isaku Yamahata
Date: Sat Sep 10 2022 - 14:11:50 EST


On Fri, Sep 09, 2022 at 11:05:34AM +0800,
Chao Gao <chao.gao@xxxxxxxxx> wrote:

> >+ * cpu_hotplug_disable() and other CPUs are offlined. No need for
> >+ * locking.
> >+ */
> >+ lockdep_assert_not_held(&kvm_lock);
> >+
> >+ if (kvm_usage_count) {
> >+ preempt_disable();
> > hardware_disable_nolock(NULL);
> >+ preempt_enable();
>
> kvm_suspend() is called with interrupt disabled. So, no need to disable
> preemption.
>
> /**
> * syscore_suspend - Execute all the registered system core suspend callbacks.
> *
> * This function is executed with one CPU on-line and disabled interrupts.
> */
> int syscore_suspend(void)

Thanks, I'll fix it with a comment.
--
Isaku Yamahata <isaku.yamahata@xxxxxxxxx>