]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: SVM: Move lock-protected allocation of SEV ASID into a separate helper
authorCarlos López <clopez@suse.de>
Tue, 10 Mar 2026 23:48:28 +0000 (16:48 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 9 Apr 2026 19:00:23 +0000 (12:00 -0700)
commit1d353dae3d33bf22fba47a96b627eeb7bfe37be8
treedf35d1a13510e1fae6214ee76aadb9409718229f
parentf09b7f4af9bb8a0e4f219bb2ed6af25b8baa8be3
KVM: SVM: Move lock-protected allocation of SEV ASID into a separate helper

Extract the lock-protected parts of SEV ASID allocation into a new helper
and opportunistically convert it to use guard() when acquiring the mutex.

Preserve the goto even though it's a little odd, as it's there's a fair
amount of subtlety that makes it surprisingly difficult to replicate the
functionality with a loop construct, and arguably using goto yields the
most readable code.

No functional change intended.

Signed-off-by: Carlos López <clopez@suse.de>
[sean: move code to separate helper, rework shortlog+changelog]
Link: https://patch.msgid.link/20260310234829.2608037-21-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c