KVM: SVM: Set sev->asid in sev_asid_new() instead of overloading the return
authorSean Christopherson <seanjc@google.com>
Wed, 31 Jan 2024 23:56:06 +0000 (15:56 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 6 Feb 2024 19:08:44 +0000 (11:08 -0800)
commitcc4ce37bed85989daf8f38bf19ea591f3b36fb0c
tree65682dd15e20aed7057faaf325fa7829e1609291
parent41bccc98fb7931d63d03f326a746ac4d429c1dd3
KVM: SVM: Set sev->asid in sev_asid_new() instead of overloading the return

Explicitly set sev->asid in sev_asid_new() when a new ASID is successfully
allocated, and return '0' to indicate success instead of overloading the
return value to multiplex the ASID with error codes.  There is exactly one
caller of sev_asid_new(), and sev_asid_free() already consumes sev->asid,
i.e. returning the ASID isn't necessary for flexibility, nor does it
provide symmetry between related APIs.

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20240131235609.4161407-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c