]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: SEV: Return appropriate error codes if SEV-ES scratch setup fails
authorSean Christopherson <seanjc@google.com>
Tue, 9 Nov 2021 22:23:49 +0000 (22:23 +0000)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 9 Dec 2021 10:10:48 +0000 (11:10 +0100)
commit2963281b9537a310dca9859ec86964fafbaf0b87
treebfcfeb6666865484885704dfdfd092bae9b9bde6
parent76ec55a4985406c078f225950c2fcd8ca30f31d8
KVM: SEV: Return appropriate error codes if SEV-ES scratch setup fails

BugLink: https://bugs.launchpad.net/bugs/1953731
[ Upstream commit 75236f5f2299b502e4b9b267c1ce3bc14a222ceb ]

Return appropriate error codes if setting up the GHCB scratch area for an
SEV-ES guest fails.  In particular, returning -EINVAL instead of -ENOMEM
when allocating the kernel buffer could be confusing as userspace would
likely suspect a guest issue.

Fixes: 8f423a80d299 ("KVM: SVM: Support MMIO for an SEV-ES guest")
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211109222350.2266045-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/x86/kvm/svm/sev.c