x86/cpu: Rework topology evaluation
Status from this message: The following commit has been merged into the x86/apic branch of tip:
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 40 patches | 45 replies | Applied | |
| v2 | 38 patches | 32 replies | Superseded | |
| v1 | 29 patches | 10 replies | Superseded |
Changes in v6 from the cover letter
- Fix the AMD leaf 0x8000008 parsing
- Update to generated CPUID leaf structures
- Address review comments (coding style, comments, changelogs, boot_cpu_has())
Patches in v6 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/19 | x86/cpu: Provide cpuid_read() et al.arch/ | +36 | 2 replies | |
| 1/19 | x86/cpu: Provide cpuid_read() et al.arch/ | +36 | 2 replies | |
| 2/19 | x86/cpu: Provide cpu_init/parse_topology()arch/ arch/ arch/ +4 more | +296 | 0 replies | |
| 3/19 | x86/cpu: Add legacy topology parserarch/ arch/ arch/ | +51 | 0 replies | |
| 4/19 | x86/cpu: Use common topology code for Centaur and Zhaoxinarch/ arch/ arch/ | +8 | 0 replies | |
| 5/19 | x86/cpu: Move __max_die_per_package to common.carch/ arch/ | +3 | 0 replies | |
| 6/19 | x86/cpu: Provide a sane leaf 0xb/0x1f parserarch/ arch/ arch/ | +143 | 0 replies | |
| 7/19 | x86/cpu: Use common topology code for Intelarch/ arch/ arch/ +2 more | +4 | 0 replies | |
| 8/19 | x86/cpu/amd: Provide a separate accessor for Node IDarch/ arch/ arch/ +6 more | +23 | 0 replies | |
| 9/19 | x86/cpu: Provide an AMD/HYGON specific topology parserarch/ arch/ arch/ +6 more | +215 | 0 replies | |
| 10/19 | x86/smpboot: Teach it about topo.amd_node_idarch/ | +8 | 0 replies | |
| 11/19 | x86/cpu: Use common topology code for AMDarch/ arch/ arch/ +1 more | +5 | 0 replies | |
| 12/19 | x86/cpu: Use common topology code for HYGONarch/ arch/ arch/ +2 more | +4 | 0 replies | |
| 13/19 | x86/mm/numa: Use core domain size on AMDarch/ arch/ | +21 | 0 replies | |
| 14/19 | x86/cpu: Make topology_amd_node_id() use the actual node infoarch/ arch/ | +4 | 0 replies | |
| 15/19 | x86/cpu: Remove topology.carch/ arch/ | +1 | 0 replies | |
| 16/19 | x86/cpu: Remove x86_coreid_bitsarch/ arch/ | +0 | 0 replies | |
| 17/19 | x86/apic: Remove unused phys_pkg_id() callbackarch/ arch/ arch/ +9 more | +0 | 0 replies | |
| 18/19 | x86/xen/smp_pv: Remove cpudata fiddlingarch/ | +0 | 0 replies | |
| 19/19 | x86/apic/uv: Remove the private leaf 0xb parserarch/ arch/ | +14 | 0 replies |
Reviews trailers per patch
3 of 20 patches have a Reviewed-by or Acked-by.
| Patch | Juergen Gross | Sohil Mehta | Michael Kelley | Peter Zijlstra (Intel) | Zhang Rui | Wang Wendy | K Prateek Nayak |
|---|---|---|---|---|---|---|---|
| Series | T-b | ||||||
| 1/19 | T-b T-b | T-b T-b | T-b T-b | T-b A-b T-b A-b | T-b T-b | T-b T-b | |
| 1/19 | T-b T-b | T-b T-b | T-b T-b | T-b A-b T-b A-b | T-b T-b | T-b T-b | |
| 2/19 | T-b | T-b | T-b | T-b A-b | T-b | T-b | |
| 3/19 | T-b | T-b | T-b | T-b | T-b | ||
| 4/19 | T-b | T-b | T-b | T-b | T-b | ||
| 5/19 | T-b | T-b | T-b | T-b | T-b | ||
| 6/19 | T-b | T-b | T-b | T-b | T-b | ||
| 7/19 | T-b | T-b | T-b | T-b | T-b | ||
| 8/19 | T-b | T-b | T-b | T-b | T-b | ||
| 9/19 | T-b | T-b | T-b | T-b | T-b | ||
| 10/19 | T-b | T-b | T-b | T-b | T-b | ||
| 11/19 | T-b | T-b | T-b | T-b | T-b | ||
| 12/19 | T-b | T-b | T-b | T-b | T-b | ||
| 13/19 | T-b | T-b | T-b | T-b | T-b | ||
| 14/19 | T-b | T-b | T-b | T-b | T-b | ||
| 15/19 | T-b | T-b | T-b | T-b | T-b | ||
| 16/19 | T-b | T-b | T-b | T-b | T-b | ||
| 17/19 | T-b | T-b | T-b | T-b | T-b | ||
| 18/19 | T-b | T-b | T-b | T-b | T-b | ||
| 19/19 | T-b | T-b | T-b | T-b | T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 7 reviewers.
Cover letter [patch V6 00/19] x86/cpu: Rework topology evaluation
This is a follow up on V5 of this work:
https://lore.kernel.org/all/[email protected]
and contains only the not yet applied part which reworks the CPUID parsing. This is also preparatory work for the general overhaul of APIC ID enumeration and management.
Changes vs. V5:
- Fix the AMD leaf 0x8000008 parsing
- Update to generated CPUID leaf structures
- Address review comments (coding style, comments, changelogs, boot_cpu_has())
This applies on Linus tree and is available from git:
git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git topo-cpuid-v6
Delta patch to V5 appended.
Thanks,
tglx
---
arch/x86/include/asm/processor.h +0 -2
@@ -705,12 +705,10 @@ static inline u32 per_cpu_l2c_id(unsigned int cpu) }#ifdef CONFIG_CPU_SUP_AMD -extern u32 amd_get_nodes_per_socket (void );extern u32 amd_get_highest_perf (void );extern void amd_clear_divider (void );extern void amd_check_microcode (void );#else -static inline u32 amd_get_nodes_per_socket (void ) {return 0 ; }static inline u32 amd_get_highest_perf (void ) {return 0 ; }static inline void amd_clear_divider (void ) { }static inline void amd_check_microcode (void ) { }
arch/x86/kernel/cpu/topology.h +2 -2
@@ -7,10 +7,10 @@ struct topo_scan {unsigned int dom_shifts[TOPO_MAX_DOMAIN ];unsigned int dom_ncpus[TOPO_MAX_DOMAIN ]; -// Legacy CPUID[1]:EBX[23:16] number of logical processors +/* Legacy CPUID[1]:EBX[23:16] number of logical processors */ unsigned int ebx1_nproc_shift; -// AMD specific node ID which cannot be mapped into APIC space. +/* AMD specific node ID which cannot be mapped into APIC space. */ u16 amd_nodes_per_pkg;u16 amd_node_id; };
arch/x86/kernel/cpu/topology_amd.c +25 -24
99 lines not on this page · raw message
arch/x86/kernel/cpu/topology_common.c +3 -3
@@ -26,7 +26,7 @@ void topology_set_dom(struct topo_scan *tscan, enum x86_topology_domains dom, } } -static unsigned int parse_num_cores (struct cpuinfo_x86 *c) +static unsigned int __maybe_unused parse_num_cores_legacy (struct cpuinfo_x86 *c) {struct { u32 cache_type : 5,
@@ -49,7 +49,7 @@ static void parse_legacy(struct topo_scan *tscan)unsigned int cores, core_shift, smt_shift =0 ;struct cpuinfo_x86 *c = tscan->c; - cores =parse_num_cores (c); + cores =parse_num_cores_legacy (c); core_shift =get_count_order (cores);if (cpu_has (c,X86_FEATURE_HT )) {
@@ -97,7 +97,7 @@ static void parse_topology(struct topo_scan *tscan, bool early) c->topo = topo_defaults;if (fake_topology (tscan)) -return ; +return ;/* Preset Initial APIC ID from CPUID leaf 1 */ cpuid_leaf_reg (1 ,CPUID_EBX , &ebx);
arch/x86/kernel/cpu/topology_ext.c +1 -1
@@ -110,7 +110,7 @@ static bool parse_topology_leaf(struct topo_scan *tscan, u32 leaf)if (!tscan->dom_shifts[TOPO_SMT_DOMAIN ] && tscan->dom_ncpus[TOPO_SMT_DOMAIN ] >1 ) {unsigned int sft =get_count_order (tscan->dom_ncpus[TOPO_SMT_DOMAIN ]); -pr_warn_once (FW_BUG "CPUID leaf 0x%x subleaf 0 has shift level 0 but %u CPUs\n" , +pr_warn_once (FW_BUG "CPUID leaf 0x%x subleaf 0 has shift level 0 but %u CPUs. Fixing it up.\n" , leaf, tscan->dom_ncpus[TOPO_SMT_DOMAIN ]);topology_update_dom (tscan,TOPO_SMT_DOMAIN , sft, tscan->dom_ncpus[TOPO_SMT_DOMAIN ]); }
arch/x86/kernel/smpboot.c +1 -1
@@ -513,7 +513,7 @@ static bool match_die(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)if (c->topo.pkg_id != o->topo.pkg_id || c->topo.die_id != o->topo.die_id)return false; -if (boot_cpu_has (X86_FEATURE_TOPOEXT ) &&topology_amd_nodes_per_pkg () >1 ) +if (cpu_feature_enabled (X86_FEATURE_TOPOEXT ) &&topology_amd_nodes_per_pkg () >1 )return c->topo.amd_node_id == o->topo.amd_node_id;return true;