Skip to content

Commit

Permalink
x86/cpu/hygon: Fix __max_die_per_package for Hygon family 18h model 4h
Browse files Browse the repository at this point in the history
From model 4h, Hygon processors use CPUID leaf 0xB to derive the
core ID, socket ID and APIC ID with the SMT and CORE level types.
But still set __max_die_per_package to nodes_per_socket because
of lacking the DIE level type.

Signed-off-by: Liao Xuan <[email protected]>
  • Loading branch information
Liao Xuan authored and Avenger-285714 committed May 25, 2024
1 parent 1b5f3e9 commit b72df95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/x86/kernel/cpu/hygon.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ static void hygon_get_topology(struct cpuinfo_x86 *c)
c->x86_max_cores /= smp_num_siblings;

/*
* In case leaf B is available, use it to derive
* From model 0x4, leaf B is available, so use it to derive
* topology information.
*/
err = detect_extended_topology(c);
if (!err)
if (!err) {
c->x86_coreid_bits = get_count_order(c->x86_max_cores);
__max_die_per_package = nodes_per_socket;
}

/*
* Socket ID is ApicId[6] for the processors with model <= 0x3
Expand Down

0 comments on commit b72df95

Please sign in to comment.