From: Tom Lendacky <thomas.lendacky@amd.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Ashish Kalra <ashish.kalra@amd.com>
Subject: Re: [PATCH v4 4/4] KVM: SVM: Return -EINVAL instead of -EBUSY on attempt to re-init SEV/SEV-ES
Date: Thu, 1 Feb 2024 10:32:37 -0600 [thread overview]
Message-ID: <41b47702-6e65-439c-aa0d-bf47647e33c6@amd.com> (raw)
In-Reply-To: <20240131235609.4161407-5-seanjc@google.com>
On 1/31/24 17:56, Sean Christopherson wrote:
> Return -EINVAL instead of -EBUSY if userspace attempts KVM_SEV{,ES}_INIT
> on a VM that already has SEV active. Returning -EBUSY is nonsencial as
> it's impossible to deactivate SEV without destroying the VM, i.e. the VM
> isn't "busy" in any sane sense of the word, and the odds of any userspace
> wanting exactly -EBUSY on a userspace bug are minuscule.
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
> ---
> arch/x86/kvm/svm/sev.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> index 38e40fbc7ea0..cb19b57e1031 100644
> --- a/arch/x86/kvm/svm/sev.c
> +++ b/arch/x86/kvm/svm/sev.c
> @@ -259,9 +259,8 @@ static int sev_guest_init(struct kvm *kvm, struct kvm_sev_cmd *argp)
> if (kvm->created_vcpus)
> return -EINVAL;
>
> - ret = -EBUSY;
> if (unlikely(sev->active))
> - return ret;
> + return -EINVAL;
>
> sev->active = true;
> sev->es_active = argp->id == KVM_SEV_ES_INIT;
next prev parent reply other threads:[~2024-02-01 16:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 23:56 [PATCH v4 0/4] Add support for allowing zero SEV ASIDs Sean Christopherson
2024-01-31 23:56 ` [PATCH v4 1/4] KVM: SVM: Set sev->asid in sev_asid_new() instead of overloading the return Sean Christopherson
2024-02-01 16:20 ` Tom Lendacky
2024-01-31 23:56 ` [PATCH v4 2/4] KVM: SVM: Use unsigned integers when dealing with ASIDs Sean Christopherson
2024-02-01 16:27 ` Tom Lendacky
2024-02-01 17:02 ` Sean Christopherson
2024-01-31 23:56 ` [PATCH v4 3/4] KVM: SVM: Add support for allowing zero SEV ASIDs Sean Christopherson
2024-01-31 23:56 ` [PATCH v4 4/4] KVM: SVM: Return -EINVAL instead of -EBUSY on attempt to re-init SEV/SEV-ES Sean Christopherson
2024-02-01 16:32 ` Tom Lendacky [this message]
2024-02-06 21:36 ` [PATCH v4 0/4] Add support for allowing zero SEV ASIDs 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=41b47702-6e65-439c-aa0d-bf47647e33c6@amd.com \
--to=thomas.lendacky@amd.com \
--cc=ashish.kalra@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.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
Powered by JetHome