From: Lin Wang <wanglin@open-hieco.net>
To: Mario Limonciello <mario.limonciello@amd.com>,
yazen.ghannam@amd.com, Borislav Petkov <bp@alien8.de>
Cc: tglx@kernel.org, mingo@redhat.com, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2 4/5] x86/amd_node: Add smn_set_roots() and smn_activate() for external SMN registration
Date: Fri, 24 Apr 2026 09:43:04 +0800 [thread overview]
Message-ID: <f0b797d7-690e-4e01-9c94-83971c836d3f@open-hieco.net> (raw)
In-Reply-To: <857e8a70-be18-4ff1-8758-693af88efa00@amd.com>
Hi Mario,
You're right. After a successful smn_set_roots(), smn_num_nodes is
guaranteed to be non-zero because smn_set_roots() already rejects
(!roots || !num_nodes). So checking !smn_roots here is sufficient.
Will fix in v3.
Thanks & Br,
Lin
On 4/24/2026 3:12 AM, Mario Limonciello wrote:
>> +/*
>> + * Activate the SMN access layer after roots have been registered via
>> + * smn_set_roots(). Creates the optional debugfs interface (gated by
>> + * the amd_smn_debugfs_enable boot parameter) and sets smn_exclusive so
>> + * that amd_smn_read()/amd_smn_write() begin accepting requests.
>> + *
>> + * @debugfs_name: directory name under arch_debugfs_dir (e.g. "amd_smn")
>> + *
>> + * Same serialization rules as smn_set_roots(): must be called exactly
>> + * once, at boot, after smn_set_roots() succeeds.
>> + */
>> +int smn_activate(const char *debugfs_name)
>> +{
>> + if (!smn_roots || !smn_num_nodes)
>> + return -EINVAL;
>
> You don't need the !smn_num_nodes check here. smn_set_roots() already
> has it.
next prev parent reply other threads:[~2026-04-24 1:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 6:04 [RFC PATCH v2 0/5] x86/hygon: Add Family 0x18 node enumeration and SMN access Lin Wang
2026-04-23 6:04 ` [RFC PATCH v2 1/5] pci_ids: Add Hygon Family 0x18 DF device IDs Lin Wang
2026-04-23 6:04 ` [RFC PATCH v2 2/5] x86/hygon: Add Family 0x18 node enumeration API header Lin Wang
2026-04-23 6:04 ` [RFC PATCH v2 3/5] x86/amd_nb: Add amd_nb_set_cache() for external NB cache registration Lin Wang
2026-04-23 6:04 ` [RFC PATCH v2 4/5] x86/amd_node: Add smn_set_roots() and smn_activate() for external SMN registration Lin Wang
2026-04-23 19:12 ` Mario Limonciello
2026-04-24 1:43 ` Lin Wang [this message]
2026-04-23 6:04 ` [RFC PATCH v2 5/5] x86/hygon: Add Fam18h node enumeration, NB cache and SMN init Lin Wang
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=f0b797d7-690e-4e01-9c94-83971c836d3f@open-hieco.net \
--to=wanglin@open-hieco.net \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mingo@redhat.com \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
--cc=yazen.ghannam@amd.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®