Skip to content

Commit 22dc963

Browse files
committed
x86/cpu: Move logical package and die IDs into topology info
Yet another topology related data pair. Rename logical_proc_id to logical_pkg_id so it fits the common naming conventions. 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 594957d commit 22dc963

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

Documentation/arch/x86/topology.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Package-related topology information in the kernel:
6767
Modern systems use this value for the socket. There may be multiple
6868
packages within a socket. This value may differ from topo.die_id.
6969

70-
- cpuinfo_x86.logical_proc_id:
70+
- cpuinfo_x86.topo.logical_pkg_id:
7171

7272
The logical ID of the package. As we do not trust BIOSes to enumerate the
7373
packages in a consistent way, we introduced the concept of logical package

arch/x86/events/intel/uncore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ int uncore_device_to_die(struct pci_dev *dev)
7474
struct cpuinfo_x86 *c = &cpu_data(cpu);
7575

7676
if (c->initialized && cpu_to_node(cpu) == node)
77-
return c->logical_die_id;
77+
return c->topo.logical_die_id;
7878
}
7979

8080
return -1;

arch/x86/include/asm/processor.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ struct cpuinfo_topology {
9595

9696
// Core ID relative to the package
9797
u32 core_id;
98+
99+
// Logical ID mappings
100+
u32 logical_pkg_id;
101+
u32 logical_die_id;
98102
};
99103

100104
struct cpuinfo_x86 {
@@ -145,10 +149,6 @@ struct cpuinfo_x86 {
145149
u16 x86_clflush_size;
146150
/* number of cores as seen by the OS: */
147151
u16 booted_cores;
148-
/* Logical processor id: */
149-
u16 logical_proc_id;
150-
/* Core id: */
151-
u16 logical_die_id;
152152
/* Index into per_cpu list: */
153153
u16 cpu_index;
154154
/* Is SMT active on this core? */

arch/x86/include/asm/topology.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ static inline void setup_node_to_cpumask_map(void) { }
105105
extern const struct cpumask *cpu_coregroup_mask(int cpu);
106106
extern const struct cpumask *cpu_clustergroup_mask(int cpu);
107107

108-
#define topology_logical_package_id(cpu) (cpu_data(cpu).logical_proc_id)
108+
#define topology_logical_package_id(cpu) (cpu_data(cpu).topo.logical_pkg_id)
109109
#define topology_physical_package_id(cpu) (cpu_data(cpu).topo.pkg_id)
110-
#define topology_logical_die_id(cpu) (cpu_data(cpu).logical_die_id)
110+
#define topology_logical_die_id(cpu) (cpu_data(cpu).topo.logical_die_id)
111111
#define topology_die_id(cpu) (cpu_data(cpu).topo.die_id)
112112
#define topology_core_id(cpu) (cpu_data(cpu).topo.core_id)
113113
#define topology_ppin(cpu) (cpu_data(cpu).ppin)

arch/x86/kernel/cpu/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,7 @@ static void validate_apic_and_package_id(struct cpuinfo_x86 *c)
18101810
BUG_ON(topology_update_package_map(c->topo.pkg_id, cpu));
18111811
BUG_ON(topology_update_die_map(c->topo.die_id, cpu));
18121812
#else
1813-
c->logical_proc_id = 0;
1813+
c->topo.logical_pkg_id = 0;
18141814
#endif
18151815
}
18161816

arch/x86/kernel/smpboot.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ int topology_phys_to_logical_pkg(unsigned int phys_pkg)
340340
struct cpuinfo_x86 *c = &cpu_data(cpu);
341341

342342
if (c->initialized && c->topo.pkg_id == phys_pkg)
343-
return c->logical_proc_id;
343+
return c->topo.logical_pkg_id;
344344
}
345345
return -1;
346346
}
@@ -362,7 +362,7 @@ static int topology_phys_to_logical_die(unsigned int die_id, unsigned int cur_cp
362362

363363
if (c->initialized && c->topo.die_id == die_id &&
364364
c->topo.pkg_id == proc_id)
365-
return c->logical_die_id;
365+
return c->topo.logical_die_id;
366366
}
367367
return -1;
368368
}
@@ -387,7 +387,7 @@ int topology_update_package_map(unsigned int pkg, unsigned int cpu)
387387
cpu, pkg, new);
388388
}
389389
found:
390-
cpu_data(cpu).logical_proc_id = new;
390+
cpu_data(cpu).topo.logical_pkg_id = new;
391391
return 0;
392392
}
393393
/**
@@ -410,7 +410,7 @@ int topology_update_die_map(unsigned int die, unsigned int cpu)
410410
cpu, die, new);
411411
}
412412
found:
413-
cpu_data(cpu).logical_die_id = new;
413+
cpu_data(cpu).topo.logical_die_id = new;
414414
return 0;
415415
}
416416

0 commit comments

Comments
 (0)