Re: [PATCH v3 1/7] x86/cpu/hygon: Adjust the die_id and logical_die_id for Hygon models 0x4 through 0x8

From: Dave Hansen

Date: Mon Jun 15 2026 - 10:08:05 EST


On 6/15/26 05:17, Fu Hao wrote:
> + /*
> + * Adjust the die_id and logical_die_id for Hygon models 0x4-0x8.
> + */
> + if (c->x86_model >= 0x4 && c->x86_model <= 0x8) {
> + c->topo.die_id = cpuid_ecx(0x8000001e) & 0xff;
> + c->topo.logical_die_id = (c->topo.die_id >> 4) *
> + topology_amd_nodes_per_pkg() +
> + (c->topo.die_id & 0xf);
> + }

My assumption for Hygon stuff is that there's AMD code _somewhere_ for
99% of it. It's just a matter of using it.

Why doesn't this use parse_8000_001e()?

I think that kind of justification needs to be the baseline for Hygon
work when it adds code. It needs to explain why the code is being added
and why the existing (AMD usually) code doesn't work.