@@ -310,12 +310,6 @@ int topology_update_package_map(unsigned int pkg, unsigned int cpu)
310
310
if (new >= 0 )
311
311
goto found ;
312
312
313
- if (logical_packages >= __max_logical_packages ) {
314
- pr_warn ("Package %u of CPU %u exceeds BIOS package data %u.\n" ,
315
- logical_packages , cpu , __max_logical_packages );
316
- return - ENOSPC ;
317
- }
318
-
319
313
new = logical_packages ++ ;
320
314
if (new != pkg ) {
321
315
pr_info ("CPU %u Converting physical %u to logical package %u\n" ,
@@ -326,52 +320,14 @@ int topology_update_package_map(unsigned int pkg, unsigned int cpu)
326
320
return 0 ;
327
321
}
328
322
329
- static void __init smp_init_package_map (struct cpuinfo_x86 * c , unsigned int cpu )
330
- {
331
- unsigned int ncpus ;
332
-
333
- /*
334
- * Today neither Intel nor AMD support heterogenous systems. That
335
- * might change in the future....
336
- *
337
- * While ideally we'd want '* smp_num_siblings' in the below @ncpus
338
- * computation, this won't actually work since some Intel BIOSes
339
- * report inconsistent HT data when they disable HT.
340
- *
341
- * In particular, they reduce the APIC-IDs to only include the cores,
342
- * but leave the CPUID topology to say there are (2) siblings.
343
- * This means we don't know how many threads there will be until
344
- * after the APIC enumeration.
345
- *
346
- * By not including this we'll sometimes over-estimate the number of
347
- * logical packages by the amount of !present siblings, but this is
348
- * still better than MAX_LOCAL_APIC.
349
- *
350
- * We use total_cpus not nr_cpu_ids because nr_cpu_ids can be limited
351
- * on the command line leading to a similar issue as the HT disable
352
- * problem because the hyperthreads are usually enumerated after the
353
- * primary cores.
354
- */
355
- ncpus = boot_cpu_data .x86_max_cores ;
356
- if (!ncpus ) {
357
- pr_warn ("x86_max_cores == zero !?!?" );
358
- ncpus = 1 ;
359
- }
360
-
361
- __max_logical_packages = DIV_ROUND_UP (total_cpus , ncpus );
362
- pr_info ("Max logical packages: %u\n" , __max_logical_packages );
363
-
364
- topology_update_package_map (c -> phys_proc_id , cpu );
365
- }
366
-
367
323
void __init smp_store_boot_cpu_info (void )
368
324
{
369
325
int id = 0 ; /* CPU 0 */
370
326
struct cpuinfo_x86 * c = & cpu_data (id );
371
327
372
328
* c = boot_cpu_data ;
373
329
c -> cpu_index = id ;
374
- smp_init_package_map ( c , id );
330
+ topology_update_package_map ( c -> phys_proc_id , id );
375
331
c -> initialized = true;
376
332
}
377
333
@@ -1341,7 +1297,16 @@ void __init native_smp_prepare_boot_cpu(void)
1341
1297
1342
1298
void __init native_smp_cpus_done (unsigned int max_cpus )
1343
1299
{
1300
+ int ncpus ;
1301
+
1344
1302
pr_debug ("Boot done\n" );
1303
+ /*
1304
+ * Today neither Intel nor AMD support heterogenous systems so
1305
+ * extrapolate the boot cpu's data to all packages.
1306
+ */
1307
+ ncpus = cpu_data (0 ).booted_cores * smp_num_siblings ;
1308
+ __max_logical_packages = DIV_ROUND_UP (nr_cpu_ids , ncpus );
1309
+ pr_info ("Max logical packages: %u\n" , __max_logical_packages );
1345
1310
1346
1311
if (x86_has_numa_in_package )
1347
1312
set_sched_topology (x86_numa_in_package_topology );
0 commit comments