From: "Ahmed S. Darwish" <darwi@linutronix.de>
To: "Nikola Z. Ivanov" <zlatistiv@gmail.com>
Cc: kprateek.nayak@amd.com, tglx@kernel.org, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
puwen@hygon.cn, mario.limonciello@amd.com, yazen.ghannam@amd.com,
andrew.cooper3@citrix.com, me@mixaill.net, kai.huang@intel.com,
i@rong.moe, sohil.mehta@intel.com, peterz@infradead.org,
xin@zytor.com, seanjc@google.com,
pawan.kumar.gupta@linux.intel.com, nikunj@amd.com,
ptesarik@suse.com, nik.borisov@suse.com,
suchitkarunakaran@gmail.com, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86/topology: Unify srat_detect_node among amd and hygon
Date: Fri, 15 May 2026 21:39:17 +0200 [thread overview]
Message-ID: <agd2ZTzSpumxn4jI@lx-t490> (raw)
In-Reply-To: <20260515163105.414436-1-zlatistiv@gmail.com>
On Fri, 15 May 2026, Nikola Z. Ivanov wrote:
>
> --- a/arch/x86/kernel/cpu/cpu.h
> +++ b/arch/x86/kernel/cpu/cpu.h
> @@ -65,6 +65,7 @@ extern void check_null_seg_clears_base(struct cpuinfo_x86 *c);
>
> void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, u16 die_id);
> void cacheinfo_hygon_init_llc_id(struct cpuinfo_x86 *c);
> +void srat_detect_node(struct cpuinfo_x86 *c);
>
This is very confusing from the perspective of common.c.
The moved srat_detect_node() function there has zero indication that it is
AMD/Hygon specific.
When I was refactoring the cacheinfo code some time ago, I marked the
vendor-specific cacheinfo.c functions with amd and/or hygon tags to
identify which is which. You see that clearly in the two lines above your
new function declaration.
IMHO, you need to do something similar. Please continue below.
>
> --- a/arch/x86/kernel/cpu/intel.c
> +++ b/arch/x86/kernel/cpu/intel.c
> @@ -468,7 +468,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
> }
> #endif
>
> -static void srat_detect_node(struct cpuinfo_x86 *c)
> +static void srat_detect_node_intel(struct cpuinfo_x86 *c)
> {
> #ifdef CONFIG_NUMA
> unsigned node;
> @@ -614,7 +614,7 @@ static void init_intel(struct cpuinfo_x86 *c)
> set_cpu_cap(c, X86_FEATURE_PREFER_YMM);
>
> /* Work around errata */
> - srat_detect_node(c);
> + srat_detect_node_intel(c);
>
I think it would be nice to have:
amd_hygon_srat_detect_node()
intel_srat_detect_node()
This would also go better in line with the existing intel.c functions like
intel_unlock_cpuid_leafs(), intel_tlb_lookup(), intel_detect_tlb(), etc.
Thanks,
Ahmed
next prev parent reply other threads:[~2026-05-15 19:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 16:31 Nikola Z. Ivanov
2026-05-15 19:39 ` Ahmed S. Darwish [this message]
2026-05-16 15:10 ` 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=agd2ZTzSpumxn4jI@lx-t490 \
--to=darwi@linutronix.de \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=i@rong.moe \
--cc=kai.huang@intel.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=me@mixaill.net \
--cc=mingo@redhat.com \
--cc=nik.borisov@suse.com \
--cc=nikunj@amd.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=peterz@infradead.org \
--cc=ptesarik@suse.com \
--cc=puwen@hygon.cn \
--cc=seanjc@google.com \
--cc=sohil.mehta@intel.com \
--cc=suchitkarunakaran@gmail.com \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
--cc=xin@zytor.com \
--cc=yazen.ghannam@amd.com \
--cc=zlatistiv@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®