mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Lin Wang <wanglin@open-hieco.net>
Cc: yazen.ghannam@amd.com, mario.limonciello@amd.com,
	tglx@kernel.org, mingo@redhat.com, x86@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 5/5] x86/amd_node: Support Hygon SMN roots by socket
Date: Fri, 3 Apr 2026 01:50:36 +0200	[thread overview]
Message-ID: <20260402235036.GDac8AzDPVVq-tBeG-@fat_crate.local> (raw)
In-Reply-To: <20260402111515.1155505-6-wanglin@open-hieco.net>

On Thu, Apr 02, 2026 at 07:15:11PM +0800, Lin Wang wrote:
> SMN root devices (PCI class 0x0600, vendor 0x1d94) are already
> enumerated by get_next_root(), which already matches the Hygon vendor
> ID. The difference from AMD is root-to-node assignment:
> 
>   AMD:   one root per node  (roots_per_node grouping)
>   Hygon: one root per socket, shared across all nodes on that socket
> 
> Extend amd_smn_init() with a Hygon branch that:
>   - uses hygon_node_num() and hygon_socket_num() to determine the node
>     and socket counts from the hygon_node cache
>   - groups the discovered roots by socket (roots_per_socket)
>   - expands them to per-node entries in amd_roots[] using
>     hygon_node_socket()
> 
> Introduce smn_num_nodes to hold the per-vendor node count, so that
> __amd_smn_rw() and the debugfs bounds check work correctly for both
> AMD and Hygon system layouts.
> 
> AMD behavior is unchanged.
> 
> Signed-off-by: Lin Wang <wanglin@open-hieco.net>
> ---
>  arch/x86/kernel/amd_node.c | 122 +++++++++++++++++++++++++++++++------
>  1 file changed, 102 insertions(+), 20 deletions(-)

All Hygon enablement goes into Hygon-specific files. If there's a piece of
functionality which is generic enough, then that can be extracted into
a function which can be called by both vendors code.

But pls forget this piggy-backing on AMD code and thus turning AMD code into
an unmaintainable mess.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2026-04-02 23:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 11:15 [RFC PATCH 00/05] x86/hygon: Add Family 0x18 node enumeration and SMN access Lin Wang
2026-04-02 11:15 ` [RFC PATCH 1/5] pci_ids: Add Hygon Family 0x18 DF device IDs Lin Wang
2026-04-02 17:56   ` Mario Limonciello
2026-04-03  3:39     ` Lin Wang
2026-04-02 11:15 ` [RFC PATCH 2/5] x86/hygon: Add Family 0x18 node enumeration API header Lin Wang
2026-04-02 11:15 ` [RFC PATCH 3/5] x86/hygon: Add DF misc-based node enumeration helpers Lin Wang
2026-04-02 18:50   ` Mario Limonciello
2026-04-03  5:15     ` Lin Wang
2026-04-02 11:15 ` [RFC PATCH 4/5] x86/amd_nb: Use Hygon DF misc enumeration for Family 0x18 Lin Wang
2026-04-02 11:15 ` [RFC PATCH 5/5] x86/amd_node: Support Hygon SMN roots by socket Lin Wang
2026-04-02 23:50   ` Borislav Petkov [this message]
2026-04-03  5:29     ` 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=20260402235036.GDac8AzDPVVq-tBeG-@fat_crate.local \
    --to=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --cc=wanglin@open-hieco.net \
    --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®