Commit 22dc9631 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

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: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarJuergen Gross <jgross@suse.com>
Tested-by: default avatarSohil Mehta <sohil.mehta@intel.com>
Tested-by: default avatarMichael Kelley <mikelley@microsoft.com>
Tested-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: default avatarZhang Rui <rui.zhang@intel.com>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230814085112.745139505@linutronix.de
parent 594957d7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ Package-related topology information in the kernel:
    Modern systems use this value for the socket. There may be multiple
    packages within a socket. This value may differ from topo.die_id.

  - cpuinfo_x86.logical_proc_id:
  - cpuinfo_x86.topo.logical_pkg_id:

    The logical ID of the package. As we do not trust BIOSes to enumerate the
    packages in a consistent way, we introduced the concept of logical package
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ int uncore_device_to_die(struct pci_dev *dev)
		struct cpuinfo_x86 *c = &cpu_data(cpu);

		if (c->initialized && cpu_to_node(cpu) == node)
			return c->logical_die_id;
			return c->topo.logical_die_id;
	}

	return -1;
+4 −4
Original line number Diff line number Diff line
@@ -95,6 +95,10 @@ struct cpuinfo_topology {

	// Core ID relative to the package
	u32			core_id;

	// Logical ID mappings
	u32			logical_pkg_id;
	u32			logical_die_id;
};

struct cpuinfo_x86 {
@@ -145,10 +149,6 @@ struct cpuinfo_x86 {
	u16			x86_clflush_size;
	/* number of cores as seen by the OS: */
	u16			booted_cores;
	/* Logical processor id: */
	u16			logical_proc_id;
	/* Core id: */
	u16			logical_die_id;
	/* Index into per_cpu list: */
	u16			cpu_index;
	/*  Is SMT active on this core? */
+2 −2
Original line number Diff line number Diff line
@@ -105,9 +105,9 @@ static inline void setup_node_to_cpumask_map(void) { }
extern const struct cpumask *cpu_coregroup_mask(int cpu);
extern const struct cpumask *cpu_clustergroup_mask(int cpu);

#define topology_logical_package_id(cpu)	(cpu_data(cpu).logical_proc_id)
#define topology_logical_package_id(cpu)	(cpu_data(cpu).topo.logical_pkg_id)
#define topology_physical_package_id(cpu)	(cpu_data(cpu).topo.pkg_id)
#define topology_logical_die_id(cpu)		(cpu_data(cpu).logical_die_id)
#define topology_logical_die_id(cpu)		(cpu_data(cpu).topo.logical_die_id)
#define topology_die_id(cpu)			(cpu_data(cpu).topo.die_id)
#define topology_core_id(cpu)			(cpu_data(cpu).topo.core_id)
#define topology_ppin(cpu)			(cpu_data(cpu).ppin)
+1 −1
Original line number Diff line number Diff line
@@ -1810,7 +1810,7 @@ static void validate_apic_and_package_id(struct cpuinfo_x86 *c)
	BUG_ON(topology_update_package_map(c->topo.pkg_id, cpu));
	BUG_ON(topology_update_die_map(c->topo.die_id, cpu));
#else
	c->logical_proc_id = 0;
	c->topo.logical_pkg_id = 0;
#endif
}

Loading