Skip to content
Commit 815c2a1c authored by Sean Christopherson's avatar Sean Christopherson Committed by Greg Kroah-Hartman
Browse files

KVM: SVM: WARN, but continue, if misc_cg_set_capacity() fails

[ Upstream commit 106ed2ca

 ]

WARN and continue if misc_cg_set_capacity() fails, as the only scenario
in which it can fail is if the specified resource is invalid, which should
never happen when CONFIG_KVM_AMD_SEV=y.  Deliberately not bailing "fixes"
a theoretical bug where KVM would leak the ASID bitmaps on failure, which
again can't happen.

If the impossible should happen, the end result is effectively the same
with respect to SEV and SEV-ES (they are unusable), while continuing on
has the advantage of letting KVM load, i.e. userspace can still run
non-SEV guests.

Reported-by: default avatarAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Link: https://lore.kernel.org/r/20230607004449.1421131-1-seanjc@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Stable-dep-of: 0aa6b90e

 ("KVM: SVM: Add support for allowing zero SEV ASIDs")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2f7efda5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment