@@ -125,23 +125,6 @@ struct mwait_cpu_dead {
125
125
*/
126
126
static DEFINE_PER_CPU_ALIGNED (struct mwait_cpu_dead , mwait_cpu_dead ) ;
127
127
128
- /* Logical package management. */
129
- struct logical_maps {
130
- u32 phys_pkg_id ;
131
- u32 phys_die_id ;
132
- u32 logical_pkg_id ;
133
- u32 logical_die_id ;
134
- };
135
-
136
- /* Temporary workaround until the full topology mechanics is in place */
137
- static DEFINE_PER_CPU_READ_MOSTLY (struct logical_maps , logical_maps ) = {
138
- .phys_pkg_id = U32_MAX ,
139
- .phys_die_id = U32_MAX ,
140
- };
141
-
142
- static unsigned int logical_packages __read_mostly ;
143
- static unsigned int logical_die __read_mostly ;
144
-
145
128
/* Maximum number of SMT threads on any online core */
146
129
int __read_mostly __max_smt_threads = 1 ;
147
130
@@ -334,103 +317,11 @@ static void notrace start_secondary(void *unused)
334
317
cpu_startup_entry (CPUHP_AP_ONLINE_IDLE );
335
318
}
336
319
337
- /**
338
- * topology_phys_to_logical_pkg - Map a physical package id to a logical
339
- * @phys_pkg: The physical package id to map
340
- *
341
- * Returns logical package id or -1 if not found
342
- */
343
- int topology_phys_to_logical_pkg (unsigned int phys_pkg )
344
- {
345
- int cpu ;
346
-
347
- for_each_possible_cpu (cpu ) {
348
- if (per_cpu (logical_maps .phys_pkg_id , cpu ) == phys_pkg )
349
- return per_cpu (logical_maps .logical_pkg_id , cpu );
350
- }
351
- return -1 ;
352
- }
353
- EXPORT_SYMBOL (topology_phys_to_logical_pkg );
354
-
355
- /**
356
- * topology_phys_to_logical_die - Map a physical die id to logical
357
- * @die_id: The physical die id to map
358
- * @cur_cpu: The CPU for which the mapping is done
359
- *
360
- * Returns logical die id or -1 if not found
361
- */
362
- static int topology_phys_to_logical_die (unsigned int die_id , unsigned int cur_cpu )
363
- {
364
- int cpu , proc_id = cpu_data (cur_cpu ).topo .pkg_id ;
365
-
366
- for_each_possible_cpu (cpu ) {
367
- if (per_cpu (logical_maps .phys_pkg_id , cpu ) == proc_id &&
368
- per_cpu (logical_maps .phys_die_id , cpu ) == die_id )
369
- return per_cpu (logical_maps .logical_die_id , cpu );
370
- }
371
- return -1 ;
372
- }
373
-
374
- /**
375
- * topology_update_package_map - Update the physical to logical package map
376
- * @pkg: The physical package id as retrieved via CPUID
377
- * @cpu: The cpu for which this is updated
378
- */
379
- int topology_update_package_map (unsigned int pkg , unsigned int cpu )
380
- {
381
- int new ;
382
-
383
- /* Already available somewhere? */
384
- new = topology_phys_to_logical_pkg (pkg );
385
- if (new >= 0 )
386
- goto found ;
387
-
388
- new = logical_packages ++ ;
389
- if (new != pkg ) {
390
- pr_info ("CPU %u Converting physical %u to logical package %u\n" ,
391
- cpu , pkg , new );
392
- }
393
- found :
394
- per_cpu (logical_maps .phys_pkg_id , cpu ) = pkg ;
395
- per_cpu (logical_maps .logical_pkg_id , cpu ) = new ;
396
- cpu_data (cpu ).topo .logical_pkg_id = new ;
397
- return 0 ;
398
- }
399
- /**
400
- * topology_update_die_map - Update the physical to logical die map
401
- * @die: The die id as retrieved via CPUID
402
- * @cpu: The cpu for which this is updated
403
- */
404
- int topology_update_die_map (unsigned int die , unsigned int cpu )
405
- {
406
- int new ;
407
-
408
- /* Already available somewhere? */
409
- new = topology_phys_to_logical_die (die , cpu );
410
- if (new >= 0 )
411
- goto found ;
412
-
413
- new = logical_die ++ ;
414
- if (new != die ) {
415
- pr_info ("CPU %u Converting physical %u to logical die %u\n" ,
416
- cpu , die , new );
417
- }
418
- found :
419
- per_cpu (logical_maps .phys_die_id , cpu ) = die ;
420
- per_cpu (logical_maps .logical_die_id , cpu ) = new ;
421
- cpu_data (cpu ).topo .logical_die_id = new ;
422
- return 0 ;
423
- }
424
-
425
320
static void __init smp_store_boot_cpu_info (void )
426
321
{
427
- int id = 0 ; /* CPU 0 */
428
- struct cpuinfo_x86 * c = & cpu_data (id );
322
+ struct cpuinfo_x86 * c = & cpu_data (0 );
429
323
430
324
* c = boot_cpu_data ;
431
- c -> cpu_index = id ;
432
- topology_update_package_map (c -> topo .pkg_id , id );
433
- topology_update_die_map (c -> topo .die_id , id );
434
325
c -> initialized = true;
435
326
}
436
327
0 commit comments