[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251219114238.3797364-1-clopez@suse.de>
Date: Fri, 19 Dec 2025 12:41:55 +0100
From: Carlos López <clopez@...e.de>
To: kvm@...r.kernel.org,
seanjc@...gle.com,
pbonzini@...hat.com
Cc: tglx@...utronix.de,
mingo@...hat.com,
bp@...en8.de,
dave.hansen@...ux.intel.com,
x86@...nel.org,
hpa@...or.com,
linux-kernel@...r.kernel.org,
Carlos López <clopez@...e.de>
Subject: [PATCH 0/6] KVM: SEV: use mutex guards for simpler error handling
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.
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 | 135 ++++++++++++++---------------------------
1 file changed, 47 insertions(+), 88 deletions(-)
base-commit: 0499add8efd72456514c6218c062911ccc922a99
--
2.51.0
Powered by blists - more mailing lists