public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] KVM: SEV: use mutex guards for simpler error handling
@ 2026-01-20 20:10 Carlos López
  2026-01-20 20:10 ` [PATCH v2 1/6] KVM: SEV: use mutex guard in snp_launch_update() Carlos López
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Carlos López @ 2026-01-20 20:10 UTC (permalink / raw)
  To: kvm, seanjc, pbonzini
  Cc: pankaj.gupta, tglx, mingo, dave.hansen, x86, hpa, linux-kernel,
	Carlos López

Replace several uses of mutex_lock() / mutex_unlock() pairs with mutex
guards, which are less error-prone and help simplify error paths,
allowing removal of all gotos in some functions. This removes around 40
lines of code in total.

This does not remove all uses of the manual lock APIs, only those that
have their error handling improved by switching to the newer API.

Changes are separated per-function for ease of review.

---
v2: Removed an unnecessary include.

Carlos López (6):
  KVM: SEV: use mutex guard in snp_launch_update()
  KVM: SEV: use mutex guard in sev_mem_enc_ioctl()
  KVM: SEV: use mutex guard in sev_mem_enc_register_region()
  KVM: SEV: use mutex guard in sev_mem_enc_unregister_region()
  KVM: SEV: use mutex guard in snp_handle_guest_req()
  KVM: SEV: use scoped mutex guard in sev_asid_new()

 arch/x86/kvm/svm/sev.c | 134 ++++++++++++++---------------------------
 1 file changed, 46 insertions(+), 88 deletions(-)


base-commit: 0499add8efd72456514c6218c062911ccc922a99
-- 
2.51.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-02-26 23:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-20 20:10 [PATCH v2 0/6] KVM: SEV: use mutex guards for simpler error handling Carlos López
2026-01-20 20:10 ` [PATCH v2 1/6] KVM: SEV: use mutex guard in snp_launch_update() Carlos López
2026-01-20 20:10 ` [PATCH v2 2/6] KVM: SEV: use mutex guard in sev_mem_enc_ioctl() Carlos López
2026-01-20 20:10 ` [PATCH v2 3/6] KVM: SEV: use mutex guard in sev_mem_enc_register_region() Carlos López
2026-01-20 20:10 ` [PATCH v2 4/6] KVM: SEV: use mutex guard in sev_mem_enc_unregister_region() Carlos López
2026-01-20 20:10 ` [PATCH v2 5/6] KVM: SEV: use mutex guard in snp_handle_guest_req() Carlos López
2026-01-20 20:10 ` [PATCH v2 6/6] KVM: SEV: use scoped mutex guard in sev_asid_new() Carlos López
2026-02-26 23:56   ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox