[PATCH v2 2/4] KVM: arm64: Avoid lock inversion when setting the VM register width

Oliver Upton oliver.upton at linux.dev
Thu Mar 23 12:49:12 PDT 2023


On Thu, Mar 23, 2023 at 07:43:04PM +0000, Marc Zyngier wrote:
> On 2023-03-23 19:20, Oliver Upton wrote:
> > On Wed, Mar 22, 2023 at 12:02:40PM +0000, Marc Zyngier wrote:
> > > On Thu, 16 Mar 2023 21:14:10 +0000, Oliver Upton <oliver.upton at linux.dev> wrote:

[...]

> > > > +#ifdef CONFIG_LOCKDEP
> > > > +	/* Inform lockdep that the config_lock is acquired after vcpu->mutex */
> > > > +	mutex_lock(&vcpu->mutex);
> > > > +	mutex_lock(&vcpu->kvm->arch.config_lock);
> > > > +	mutex_unlock(&vcpu->kvm->arch.config_lock);
> > > > +	mutex_unlock(&vcpu->mutex);
> > > > +#endif
> > > 
> > > Shouldn't this hunk be moved to the previous patch?
> > 
> > Uh, I don't believe so since this is the patch that actually introduces
> > kvm_arch::config_lock. The last patch was aimed at a separate lock for
> > mp state.
> 
> Nah, you're obviously right. I reviewed this at 4am being jet-lagged.
> Not the brightest comment... :-/ Sorry for the noise.

No problem at all! I wish I had as good of an excuse as you for the times
I gave far worse feedback...

-- 
Thanks,
Oliver



More information about the linux-arm-kernel mailing list