mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gupta, Pankaj" <pankaj.gupta@amd.com>
To: "Carlos López" <clopez@suse.de>,
	kvm@vger.kernel.org, seanjc@google.com, pbonzini@redhat.com
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/6] KVM: SEV: use mutex guards for simpler error handling
Date: Tue, 30 Dec 2025 15:30:09 +0100	[thread overview]
Message-ID: <2db152db-2333-4aac-8d77-fa32f850df91@amd.com> (raw)
In-Reply-To: <20251219114238.3797364-1-clopez@suse.de>


> 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(-)


Did a basic boot test on SEV{ES & SNP} VM.

Thanks,

Pankaj

>
>
> base-commit: 0499add8efd72456514c6218c062911ccc922a99

      parent reply	other threads:[~2025-12-30 14:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19 11:41 Carlos López
2025-12-19 11:41 ` [PATCH 1/6] KVM: SEV: use mutex guard in snp_launch_update() Carlos López
2025-12-30 14:10   ` Gupta, Pankaj
2025-12-19 11:41 ` [PATCH 2/6] KVM: SEV: use mutex guard in sev_mem_enc_ioctl() Carlos López
2025-12-30 14:16   ` Gupta, Pankaj
2025-12-19 11:41 ` [PATCH 3/6] KVM: SEV: use mutex guard in sev_mem_enc_register_region() Carlos López
2025-12-19 11:41 ` [PATCH 4/6] KVM: SEV: use mutex guard in sev_mem_enc_unregister_region() Carlos López
2025-12-30 14:18   ` Gupta, Pankaj
2025-12-19 11:42 ` [PATCH 5/6] KVM: SEV: use mutex guard in snp_handle_guest_req() Carlos López
2025-12-30 14:20   ` Gupta, Pankaj
2025-12-19 11:42 ` [PATCH 6/6] KVM: SEV: use scoped mutex guard in sev_asid_new() Carlos López
2025-12-30 14:30 ` Gupta, Pankaj [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2db152db-2333-4aac-8d77-fa32f850df91@amd.com \
    --to=pankaj.gupta@amd.com \
    --cc=bp@alien8.de \
    --cc=clopez@suse.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®