From: sashiko-bot@kernel.org
To: "Ashish Kalra" <Ashish.Kalra@amd.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v13 3/5] x86/sev: Initialize RMPOPT configuration MSRs
Date: Wed, 02 Sep 2026 21:44:59 +0000 [thread overview]
Message-ID: <20260902214500.6B06D1F00A3F@smtp.kernel.org> (raw)
In-Reply-To: <3ee20e3956ab0529aa7bf526b6a743fe970089a3.1788296083.git.ashish.kalra@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] CPU hotplug lock is leaked if SEV-SNP initialization fails.
--
commit 16bd9580b377dc645541bd4f478c471c109e65ae
Author: Ashish Kalra <ashish.kalra@amd.com>
x86/sev: Initialize RMPOPT configuration MSRs
This commit introduces the RMPOPT configuration MSRs and adds support to
set up and enable RMPOPT once SNP is initialized. The RMPOPT table base
is initialized to enable RMP optimization for up to 2 TB of system RAM.
> diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c
> index f833cb7e4da36..287a8345854ba 100644
> --- a/drivers/crypto/ccp/sev-dev.c
> +++ b/drivers/crypto/ccp/sev-dev.c
> @@ -1663,6 +1663,8 @@ static int __sev_snp_init_locked(int *error, unsigned int max_snp_asid)
>
> sev_es_tmr_size = SNP_TMR_SIZE;
>
> + snp_setup_rmpopt();
> +
[Severity: High]
This is a pre-existing issue, but does __sev_snp_init_locked() permanently
leak the CPU hotplug lock if SEV-SNP initialization fails?
If snp_prepare() succeeds, it disables CPU hotplug. However, if an error
occurs later in the function (for example, if walk_iomem_res_desc() fails),
the function returns the error code without re-enabling CPU hotplug:
drivers/crypto/ccp/sev-dev.c:__sev_snp_init_locked() {
...
rc = snp_prepare();
if (rc)
return rc;
...
rc = walk_iomem_res_desc(IORES_DESC_NONE, IORESOURCE_MEM, 0, ~0,
snp_range_list, snp_filter_reserved_mem_regions);
if (rc) {
dev_err(sev->dev,
"SEV: SNP_INIT_EX walk_iomem_res_desc failed rc = %d\n", rc);
return rc;
}
...
}
This leaves cpu_hotplug_disabled strictly greater than zero, which would
permanently prevent CPUs from being onlined or offlined. Does this function
need an error handling path that calls cpu_hotplug_enable() before returning
on these failure paths?
> return 0;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1788296083.git.ashish.kalra@amd.com?part=3
next prev parent reply other threads:[~2026-09-02 21:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 21:27 [PATCH v13 0/5] Add RMPOPT support Ashish Kalra
2026-09-02 21:27 ` [PATCH v13 1/5] x86/cpufeatures: Add X86_FEATURE_RMPOPT feature flag Ashish Kalra
2026-09-02 21:28 ` [PATCH v13 2/5] x86/sev: Disable CPU hotplug while SNP is active Ashish Kalra
2026-09-02 21:51 ` sashiko-bot
2026-09-02 22:12 ` Kalra, Ashish
2026-09-02 21:28 ` [PATCH v13 3/5] x86/sev: Initialize RMPOPT configuration MSRs Ashish Kalra
2026-09-02 21:44 ` sashiko-bot [this message]
2026-09-02 21:56 ` Kalra, Ashish
2026-09-02 21:28 ` [PATCH v13 4/5] x86/sev: Add support to perform RMP optimizations asynchronously Ashish Kalra
2026-09-02 21:36 ` Dave Hansen
2026-09-02 21:57 ` sashiko-bot
2026-09-02 22:36 ` Kalra, Ashish
2026-09-02 21:29 ` [PATCH v13 5/5] x86/sev: Re-enable RMP optimizations on SNP guest shutdown Ashish Kalra
2026-09-02 21:37 ` Dave Hansen
2026-09-02 22:01 ` sashiko-bot
2026-09-02 22:45 ` Kalra, Ashish
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=20260902214500.6B06D1F00A3F@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Ashish.Kalra@amd.com \
--cc=kvm@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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