From: Sean Christopherson <seanjc@google.com>
To: James Houghton <jthoughton@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Alexander Potapenko <glider@google.com>,
Peter Gonda <pgonda@google.com>,
Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [PATCH 1/2] KVM: SVM: Reject SEV{-ES} intra host migration if vCPU creation is in-flight
Date: Tue, 3 Jun 2025 12:00:12 -0700 [thread overview]
Message-ID: <aD9GPPz9U5JU89b-@google.com> (raw)
In-Reply-To: <CADrL8HWvYwxTvRQFzk33aaDLgnSzgBvCaTW_1vP-fBuaC_K4Sw@mail.gmail.com>
On Tue, Jun 03, 2025, James Houghton wrote:
> On Mon, Jun 2, 2025 at 3:45 PM Sean Christopherson <seanjc@google.com> wrote:
> > ---
> > arch/x86/kvm/svm/sev.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> > index a7a7dc507336..93d899454535 100644
> > --- a/arch/x86/kvm/svm/sev.c
> > +++ b/arch/x86/kvm/svm/sev.c
> > @@ -2032,6 +2032,10 @@ static int sev_check_source_vcpus(struct kvm *dst, struct kvm *src)
> > struct kvm_vcpu *src_vcpu;
> > unsigned long i;
> >
> > + if (src->created_vcpus != atomic_read(&src->online_vcpus) ||
> > + dst->created_vcpus != atomic_read(&dst->online_vcpus))
> > + return -EINVAL;
>
> I think -EBUSY (or perhaps -EAGAIN) might be a more proper return code.
Yeah, I was 50/50 on EBUSY vs EINVAL. I think I went with EINVAL mostly out of
spite :-)
I'll change it to EBUSY.
next prev parent reply other threads:[~2025-06-03 19:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-02 22:44 [PATCH 0/2] KVM: SVM: Fix a NULL VMSA deref with MOVE_ENC_CONTEXT Sean Christopherson
2025-06-02 22:44 ` [PATCH 1/2] KVM: SVM: Reject SEV{-ES} intra host migration if vCPU creation is in-flight Sean Christopherson
2025-06-03 15:21 ` James Houghton
2025-06-03 19:00 ` Sean Christopherson [this message]
2025-06-04 11:15 ` Liam Merwick
2025-06-02 22:44 ` [PATCH 2/2] KVM: SVM: Initialize vmsa_pa in VMCB to INVALID_PAGE if VMSA page is NULL Sean Christopherson
2025-06-04 11:15 ` Liam Merwick
2025-06-04 15:02 ` [PATCH 0/2] KVM: SVM: Fix a NULL VMSA deref with MOVE_ENC_CONTEXT Paolo Bonzini
2025-06-24 19:38 ` Sean Christopherson
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=aD9GPPz9U5JU89b-@google.com \
--to=seanjc@google.com \
--cc=glider@google.com \
--cc=jthoughton@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=pgonda@google.com \
--cc=thomas.lendacky@amd.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