Commit 8876406e authored by Pu Wen's avatar Pu Wen
Browse files

x86/cpu/hygon: Fix __max_die_per_package for Hygon family 18h model 4h

hygon inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8U3EG


CVE: NA

---------------------------

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: default avatarPu Wen <puwen@hygon.cn>
parent d553095c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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