Re: [PATCH v2] KVM: SEV: Mark nested locking of vcpu->mutex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 6, 2022 at 12:06 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> On Tue, Apr 05, 2022, Peter Gonda wrote:
> > diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> > index 75fa6dd268f0..673e1ee2cfc9 100644
> > --- a/arch/x86/kvm/svm/sev.c
> > +++ b/arch/x86/kvm/svm/sev.c
> > @@ -1591,14 +1591,21 @@ static void sev_unlock_two_vms(struct kvm *dst_kvm, struct kvm *src_kvm)
> >       atomic_set_release(&src_sev->migration_in_progress, 0);
> >  }
> >
> > +#define SEV_MIGRATION_SOURCE 0
> > +#define SEV_MIGRATION_TARGET 1
> >
> > -static int sev_lock_vcpus_for_migration(struct kvm *kvm)
> > +/*
> > + * To avoid lockdep warnings callers should pass @vm argument with either
>
> I think it's important to call that these are false positives, saying "avoid
> lockdep warnings" suggests we're intentionally not fixing bugs :-)
>
> > + * SEV_MIGRATION_SOURCE or SEV_MIGRATE_TARGET. This allows subclassing of all
> > + * vCPU mutex locks.
> > + */
>
> If we use an enum, that'll make the param self-documenting.  And we can also use
> that to eliminate the remaining magic number '2'.  E.g. this as fixup.

Sounds good. I took this fixup into the V3. Thanks.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux