Skip to content

Commit e3c0c5d

Browse files
committed
x86/cpu: Move cu_id into topology info
No functional change. Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Juergen Gross <[email protected]> Tested-by: Sohil Mehta <[email protected]> Tested-by: Michael Kelley <[email protected]> Tested-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Zhang Rui <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e952563 commit e3c0c5d

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

arch/x86/include/asm/processor.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ struct cpuinfo_topology {
9090
// Physical die ID on AMD, Relative on Intel
9191
u32 die_id;
9292

93+
// Compute unit ID - AMD specific
94+
u32 cu_id;
95+
9396
// Core ID relative to the package
9497
u32 core_id;
9598
};
@@ -110,7 +113,6 @@ struct cpuinfo_x86 {
110113
__u8 x86_phys_bits;
111114
/* CPUID returned core id bits: */
112115
__u8 x86_coreid_bits;
113-
__u8 cu_id;
114116
/* Max extended CPUID function supported: */
115117
__u32 extended_cpuid_level;
116118
/* Maximum supported CPUID level, -1=no CPUID: */

arch/x86/kernel/cpu/amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
413413
c->topo.die_id = ecx & 0xff;
414414

415415
if (c->x86 == 0x15)
416-
c->cu_id = ebx & 0xff;
416+
c->topo.cu_id = ebx & 0xff;
417417

418418
if (c->x86 >= 0x17) {
419419
c->topo.core_id = ebx & 0xff;

arch/x86/kernel/cpu/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)
18291829
c->x86_model_id[0] = '\0'; /* Unset */
18301830
c->x86_max_cores = 1;
18311831
c->x86_coreid_bits = 0;
1832-
c->cu_id = 0xff;
1832+
c->topo.cu_id = 0xff;
18331833
#ifdef CONFIG_X86_64
18341834
c->x86_clflush_size = 64;
18351835
c->x86_phys_bits = 36;

arch/x86/kernel/smpboot.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,9 @@ static bool match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
482482
if (c->topo.core_id == o->topo.core_id)
483483
return topology_sane(c, o, "smt");
484484

485-
if ((c->cu_id != 0xff) &&
486-
(o->cu_id != 0xff) &&
487-
(c->cu_id == o->cu_id))
485+
if ((c->topo.cu_id != 0xff) &&
486+
(o->topo.cu_id != 0xff) &&
487+
(c->topo.cu_id == o->topo.cu_id))
488488
return topology_sane(c, o, "smt");
489489
}
490490

0 commit comments

Comments
 (0)