]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: SVM: Use guard(mutex) to simplify SNP vCPU state updates
authorSean Christopherson <seanjc@google.com>
Thu, 27 Feb 2025 01:25:40 +0000 (17:25 -0800)
committerSean Christopherson <seanjc@google.com>
Mon, 3 Mar 2025 15:34:55 +0000 (07:34 -0800)
commit5279d6f7e43d9c5863411482943200bf5ab8a261
tree5e2d5e59770b229b59ad329f82cd5c7e072a325e
parente268beee4a25ce58807a96253e95e96c2e3a5c1a
KVM: SVM: Use guard(mutex) to simplify SNP vCPU state updates

Use guard(mutex) in sev_snp_init_protected_guest_state() and pull in its
lock-protected inner helper.  Without an unlock trampoline (and even with
one), there is no real need for an inner helper.  Eliminating the helper
also avoids having to fixup the open coded "lockdep" WARN_ON().

Opportunistically drop the error message if KVM can't obtain the pfn for
the new target VMSA.  The error message provides zero information that
can't be gleaned from the fact that the vCPU is stuck.

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