[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMkAt6ompYSJK0xgmuyMTacLP2+iBjXapVWvj53sYjfzfDJjKQ@mail.gmail.com>
Date: Thu, 7 Apr 2022 13:59:02 -0600
From: Peter Gonda <pgonda@...gle.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: kvm list <kvm@...r.kernel.org>,
John Sperbeck <jsperbeck@...gle.com>,
David Rientjes <rientjes@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] KVM: SEV: Mark nested locking of vcpu->mutex
On Wed, Apr 6, 2022 at 12:06 PM Sean Christopherson <seanjc@...gle.com> 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.
Powered by blists - more mailing lists