forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
kernel/arch/x86/kernel/cpu/topology.c
....@@ -79,7 +79,7 @@
7979 * initial apic id, which also represents 32-bit extended x2apic id.
8080 */
8181 c->initial_apicid = edx;
82
- smp_num_siblings = LEVEL_MAX_SIBLINGS(ebx);
82
+ smp_num_siblings = max_t(int, smp_num_siblings, LEVEL_MAX_SIBLINGS(ebx));
8383 #endif
8484 return 0;
8585 }
....@@ -109,7 +109,8 @@
109109 */
110110 cpuid_count(leaf, SMT_LEVEL, &eax, &ebx, &ecx, &edx);
111111 c->initial_apicid = edx;
112
- core_level_siblings = smp_num_siblings = LEVEL_MAX_SIBLINGS(ebx);
112
+ core_level_siblings = LEVEL_MAX_SIBLINGS(ebx);
113
+ smp_num_siblings = max_t(int, smp_num_siblings, LEVEL_MAX_SIBLINGS(ebx));
113114 core_plus_mask_width = ht_mask_width = BITS_SHIFT_NEXT_LEVEL(eax);
114115 die_level_siblings = LEVEL_MAX_SIBLINGS(ebx);
115116 pkg_mask_width = die_plus_mask_width = BITS_SHIFT_NEXT_LEVEL(eax);