From: Joerg Roedel <joro@8bytes.org>
To: Peter Gonda <pgonda@google.com>
Cc: kvm@vger.kernel.org, Sean Christopherson <seanjc@google.com>,
Marc Orr <marcorr@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
David Rientjes <rientjes@google.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Brijesh Singh <brijesh.singh@amd.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4 V8] KVM: SEV: Add support for SEV intra host migration
Date: Tue, 28 Sep 2021 14:42:19 +0200 [thread overview]
Message-ID: <YVMNq4wwjYZ8F7N8@8bytes.org> (raw)
In-Reply-To: <20210914164727.3007031-2-pgonda@google.com>
On Tue, Sep 14, 2021 at 09:47:24AM -0700, Peter Gonda wrote:
> +static int sev_lock_vcpus_for_migration(struct kvm *kvm)
> +{
> + struct kvm_vcpu *vcpu;
> + int i, j;
> +
> + kvm_for_each_vcpu(i, vcpu, kvm) {
> + if (mutex_lock_killable(&vcpu->mutex))
> + goto out_unlock;
> + }
> +
> + return 0;
> +
> +out_unlock:
> + kvm_for_each_vcpu(j, vcpu, kvm) {
> + mutex_unlock(&vcpu->mutex);
> + if (i == j)
> + break;
Hmm, doesn't the mutex_unlock() need to happen after the check?
next prev parent reply other threads:[~2021-09-28 12:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-14 16:47 [PATCH 0/4 V8] Add AMD SEV and SEV-ES intra host migration support Peter Gonda
2021-09-14 16:47 ` [PATCH 1/4 V8] KVM: SEV: Add support for SEV intra host migration Peter Gonda
2021-09-28 12:42 ` Joerg Roedel [this message]
2021-09-28 15:30 ` Peter Gonda
2021-09-14 16:47 ` [PATCH 2/4 V8] KVM: SEV: Add support for SEV-ES " Peter Gonda
2021-09-14 16:47 ` [PATCH 3/4 V8] selftest: KVM: Add open sev dev helper Peter Gonda
2021-09-15 17:09 ` Marc Orr
2021-09-14 16:47 ` [PATCH 4/4 V8] selftest: KVM: Add intra host migration tests Peter Gonda
2021-09-15 17:27 ` Marc Orr
2021-09-21 14:20 ` Peter Gonda
2021-09-22 16:34 ` Marc Orr
2021-09-22 16:52 ` Peter Gonda
2021-09-22 16:59 ` Marc Orr
2021-09-22 17:02 ` Peter Gonda
2021-09-22 17:05 ` Marc Orr
2021-09-22 17:04 ` Marc Orr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YVMNq4wwjYZ8F7N8@8bytes.org \
--to=joro@8bytes.org \
--cc=bp@alien8.de \
--cc=brijesh.singh@amd.com \
--cc=dgilbert@redhat.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcorr@google.com \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=pgonda@google.com \
--cc=rientjes@google.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox