mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yazen Ghannam <yazen.ghannam@amd.com>
To: Ilan Bonneau-Zamon <yolezz.secret@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H . Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Ilan Bonneau-Zamon <ilan.bonneauzamon@gmail.com>
Subject: Re: [PATCH v9] x86/amd_node: Continue initialization even if SMN reservation fails
Date: Mon, 30 Nov 2026 13:12:07 -0500	[thread overview]
Message-ID: <20261130181207.GB212336@yaz-khff2.amd.com> (raw)
In-Reply-To: <20261130172815.18404-1-ilan.bonneauzamon@gmail.com>

On Mon, Nov 30, 2026 at 06:28:15PM +0100, Ilan Bonneau-Zamon wrote:
> On multi-root AMD systems, another driver or firmware mechanism may
> already have reserved the PCI config space of a single root device.
> Aborting amd_smn_init() on the first reservation failure needlessly
> prevents initializing and protecting the SMN registers on the remaining
> roots.
> 
> However, if reserving PCI config space fails for every discovered root,
> no SMN protection is in place at all and initialization must still
> fail with -EEXIST.
> 
> Suggested-by: Yazen Ghannam <yazen.ghannam@amd.com>
> Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
> Signed-off-by: Ilan Bonneau-Zamon <ilan.bonneauzamon@gmail.com>
> ---
> Changes in v9:
> - Rewrite commit message to focus on why the change is needed rather
>   than describing what the diff does.
> Changes in v8:
> - Track failed reservations and return -EEXIST if all roots fail.
> - Add Suggested-by tag for Mario Limonciello.
> ---
>  arch/x86/kernel/amd_node.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c
> index b7926ba3610a..14a97df63ce2 100644
> --- a/arch/x86/kernel/amd_node.c
> +++ b/arch/x86/kernel/amd_node.c
> @@ -250,8 +250,8 @@ __setup("amd_smn_debugfs_enable", amd_smn_enable_dfs);
>  
>  static int __init amd_smn_init(void)
>  {
> -	u16 count, num_roots, roots_per_node, node, num_nodes;
> -	struct pci_dev *root __free(pci_dev_put) = NULL;
> +	u16 count, num_roots = 0, failed = 0, roots_per_node, node, num_nodes;
> +	struct pci_dev *root = NULL;
>  
>  	if (!cpu_feature_enabled(X86_FEATURE_ZEN))
>  		return 0;
> @@ -261,7 +261,6 @@ static int __init amd_smn_init(void)
>  	if (amd_roots)
>  		return 0;
>  
> -	num_roots = 0;
>  	while ((root = get_next_root(root))) {
>  		pci_dbg(root, "Reserving PCI config space\n");
>  

You didn't answer about these changes.

Thanks,
Yazen

  reply	other threads:[~2026-11-30 18:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Message-ID-de-Mario>
2026-11-29 10:38 ` [PATCH v8] " Ilan Bonneau-Zamon
2026-11-29 18:12   ` Borislav Petkov
2026-11-30 17:28     ` [PATCH v9] " Ilan Bonneau-Zamon
2026-11-30 18:12       ` Yazen Ghannam [this message]
2026-11-30 18:53         ` Ilan Bonneau-Zamon
2026-11-30 18:34       ` Borislav Petkov
2026-11-30 18:53         ` Ilan Bonneau-Zamon
2026-11-30 18:59           ` Borislav Petkov

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=20261130181207.GB212336@yaz-khff2.amd.com \
    --to=yazen.ghannam@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=ilan.bonneauzamon@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=yolezz.secret@gmail.com \
    /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®