Re: [PATCH v4 4/5] x86/amd_node: Skip SMN setup on Hygon Fam18h models 0x04-0x08
From: Lin Wang
Date: Wed Sep 02 2026 - 21:50:21 EST
On 9/2/2026 11:13 PM, Borislav Petkov wrote:
On Wed, Sep 02, 2026 at 02:22:13PM +0800, Lin Wang wrote:
Please let me know how you would prefer this to be handled.
Well, X86_FEATURE_ZEN isn't Hygon apparently. Otherwise, we wouldn't be having
this conversation. And we wouldn't need ugly workarounds like that.
Which means, you cannot set it on Hygon. Instead, you should check vendor or
define your own X86_FEATURE_HYGON if you think it would be useful to denote
common set of features between all Hygon cores.
Reusing an AMD-specific flag but then having different hardware which needs
hacks and workarounds to the code is not what you do. Hygon is a different
vendor and it should be treated as such - not piggyback on AMD code.
Unless you wanna piggyback. But then you have to extract it properly and make
it generic so that it can be shared. I have been asking all people submitting
Hygon code to do that and you are starting to do it but then you need to stick
to it and do only that.
Hi Boris,
Thanks for clarifying the direction.
My proposed approach is to use explicit vendor checks to make
init_amd_nbs() and amd_smn_init() AMD-only. Hygon node enumeration and
SMN setup would remain in Hygon code.
Sashiko's concern with v3 was that the AMD initializers were restricted
while Hygon call sites remained. However, as currently implemented, the
AMD NB and SMN paths are based on AMD topology assumptions and cannot
provide the Hygon node and SMN mappings.
I would first stop the affected Hygon call sites from entering those AMD
paths, and then make the two initializers AMD-only in the same series.
Later driver support would use the Hygon interfaces.
Would this ordering address the Sashiko concern?
Thanks & Br,
Lin