smpboot.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. /*
  2. * linux/arch/m32r/kernel/smpboot.c
  3. * orig : i386 2.4.10
  4. *
  5. * M32R SMP booting functions
  6. *
  7. * Copyright (c) 2001, 2002, 2003 Hitoshi Yamamoto
  8. *
  9. * Taken from i386 version.
  10. * (c) 1995 Alan Cox, Building #3 <alan@redhat.com>
  11. * (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com>
  12. *
  13. * Much of the core SMP work is based on previous work by Thomas Radke, to
  14. * whom a great many thanks are extended.
  15. *
  16. * Thanks to Intel for making available several different Pentium,
  17. * Pentium Pro and Pentium-II/Xeon MP machines.
  18. * Original development of Linux SMP code supported by Caldera.
  19. *
  20. * This code is released under the GNU General Public License version 2 or
  21. * later.
  22. *
  23. * Fixes
  24. * Felix Koop : NR_CPUS used properly
  25. * Jose Renau : Handle single CPU case.
  26. * Alan Cox : By repeated request
  27. * 8) - Total BogoMIP report.
  28. * Greg Wright : Fix for kernel stacks panic.
  29. * Erich Boleyn : MP v1.4 and additional changes.
  30. * Matthias Sattler : Changes for 2.1 kernel map.
  31. * Michel Lespinasse : Changes for 2.1 kernel map.
  32. * Michael Chastain : Change trampoline.S to gnu as.
  33. * Alan Cox : Dumb bug: 'B' step PPro's are fine
  34. * Ingo Molnar : Added APIC timers, based on code
  35. * from Jose Renau
  36. * Ingo Molnar : various cleanups and rewrites
  37. * Tigran Aivazian : fixed "0.00 in /proc/uptime on SMP" bug.
  38. * Maciej W. Rozycki : Bits for genuine 82489DX APICs
  39. * Martin J. Bligh : Added support for multi-quad systems
  40. */
  41. #include <linux/module.h>
  42. #include <linux/init.h>
  43. #include <linux/kernel.h>
  44. #include <linux/mm.h>
  45. #include <linux/err.h>
  46. #include <linux/irq.h>
  47. #include <linux/bootmem.h>
  48. #include <linux/delay.h>
  49. #include <asm/io.h>
  50. #include <asm/pgalloc.h>
  51. #include <asm/tlbflush.h>
  52. #define DEBUG_SMP
  53. #ifdef DEBUG_SMP
  54. #define Dprintk(x...) printk(x)
  55. #else
  56. #define Dprintk(x...)
  57. #endif
  58. extern cpumask_t cpu_initialized;
  59. /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
  60. /* Data structures and variables */
  61. /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
  62. /* Processor that is doing the boot up */
  63. static unsigned int bsp_phys_id = -1;
  64. /* Bitmask of physically existing CPUs */
  65. physid_mask_t phys_cpu_present_map;
  66. /* Bitmask of currently online CPUs */
  67. cpumask_t cpu_online_map;
  68. EXPORT_SYMBOL(cpu_online_map);
  69. cpumask_t cpu_bootout_map;
  70. cpumask_t cpu_bootin_map;
  71. static cpumask_t cpu_callin_map;
  72. cpumask_t cpu_callout_map;
  73. EXPORT_SYMBOL(cpu_callout_map);
  74. cpumask_t cpu_possible_map = CPU_MASK_ALL;
  75. EXPORT_SYMBOL(cpu_possible_map);
  76. /* Per CPU bogomips and other parameters */
  77. struct cpuinfo_m32r cpu_data[NR_CPUS] __cacheline_aligned;
  78. static int cpucount;
  79. static cpumask_t smp_commenced_mask;
  80. extern struct {
  81. void * spi;
  82. unsigned short ss;
  83. } stack_start;
  84. /* which physical physical ID maps to which logical CPU number */
  85. static volatile int physid_2_cpu[NR_CPUS];
  86. #define physid_to_cpu(physid) physid_2_cpu[physid]
  87. /* which logical CPU number maps to which physical ID */
  88. volatile int cpu_2_physid[NR_CPUS];
  89. DEFINE_PER_CPU(int, prof_multiplier) = 1;
  90. DEFINE_PER_CPU(int, prof_old_multiplier) = 1;
  91. DEFINE_PER_CPU(int, prof_counter) = 1;
  92. spinlock_t ipi_lock[NR_IPIS];
  93. static unsigned int calibration_result;
  94. /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
  95. /* Function Prototypes */
  96. /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
  97. void smp_prepare_boot_cpu(void);
  98. void smp_prepare_cpus(unsigned int);
  99. static void init_ipi_lock(void);
  100. static void do_boot_cpu(int);
  101. int __cpu_up(unsigned int);
  102. void smp_cpus_done(unsigned int);
  103. int start_secondary(void *);
  104. static void smp_callin(void);
  105. static void smp_online(void);
  106. static void show_mp_info(int);
  107. static void smp_store_cpu_info(int);
  108. static void show_cpu_info(int);
  109. int setup_profiling_timer(unsigned int);
  110. static void init_cpu_to_physid(void);
  111. static void map_cpu_to_physid(int, int);
  112. static void unmap_cpu_to_physid(int, int);
  113. /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
  114. /* Boot up APs Routins : BSP */
  115. /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
  116. void __devinit smp_prepare_boot_cpu(void)
  117. {
  118. bsp_phys_id = hard_smp_processor_id();
  119. physid_set(bsp_phys_id, phys_cpu_present_map);
  120. cpu_set(0, cpu_online_map); /* BSP's cpu_id == 0 */
  121. cpu_set(0, cpu_callout_map);
  122. cpu_set(0, cpu_callin_map);
  123. /*
  124. * Initialize the logical to physical CPU number mapping
  125. */
  126. init_cpu_to_physid();
  127. map_cpu_to_physid(0, bsp_phys_id);
  128. current_thread_info()->cpu = 0;
  129. }
  130. /*==========================================================================*
  131. * Name: smp_prepare_cpus (old smp_boot_cpus)
  132. *
  133. * Description: This routine boot up APs.
  134. *
  135. * Born on Date: 2002.02.05
  136. *
  137. * Arguments: NONE
  138. *
  139. * Returns: void (cannot fail)
  140. *
  141. * Modification log:
  142. * Date Who Description
  143. * ---------- --- --------------------------------------------------------
  144. * 2003-06-24 hy modify for linux-2.5.69
  145. *
  146. *==========================================================================*/
  147. void __init smp_prepare_cpus(unsigned int max_cpus)
  148. {
  149. int phys_id;
  150. unsigned long nr_cpu;
  151. nr_cpu = inl(M32R_FPGA_NUM_OF_CPUS_PORTL);
  152. if (nr_cpu > NR_CPUS) {
  153. printk(KERN_INFO "NUM_OF_CPUS reg. value [%ld] > NR_CPU [%d]",
  154. nr_cpu, NR_CPUS);
  155. goto smp_done;
  156. }
  157. for (phys_id = 0 ; phys_id < nr_cpu ; phys_id++)
  158. physid_set(phys_id, phys_cpu_present_map);
  159. #ifndef CONFIG_HOTPLUG_CPU
  160. cpu_present_map = cpu_possible_map;
  161. #endif
  162. show_mp_info(nr_cpu);
  163. init_ipi_lock();
  164. /*
  165. * Setup boot CPU information
  166. */
  167. smp_store_cpu_info(0); /* Final full version of the data */
  168. /*
  169. * If SMP should be disabled, then really disable it!
  170. */
  171. if (!max_cpus) {
  172. printk(KERN_INFO "SMP mode deactivated by commandline.\n");
  173. goto smp_done;
  174. }
  175. /*
  176. * Now scan the CPU present map and fire up the other CPUs.
  177. */
  178. Dprintk("CPU present map : %lx\n", physids_coerce(phys_cpu_present_map));
  179. for (phys_id = 0 ; phys_id < NR_CPUS ; phys_id++) {
  180. /*
  181. * Don't even attempt to start the boot CPU!
  182. */
  183. if (phys_id == bsp_phys_id)
  184. continue;
  185. if (!physid_isset(phys_id, phys_cpu_present_map))
  186. continue;
  187. if ((max_cpus >= 0) && (max_cpus <= cpucount + 1))
  188. continue;
  189. do_boot_cpu(phys_id);
  190. /*
  191. * Make sure we unmap all failed CPUs
  192. */
  193. if (physid_to_cpu(phys_id) == -1) {
  194. physid_clear(phys_id, phys_cpu_present_map);
  195. printk("phys CPU#%d not responding - " \
  196. "cannot use it.\n", phys_id);
  197. }
  198. }
  199. smp_done:
  200. Dprintk("Boot done.\n");
  201. }
  202. /*
  203. * init_ipi_lock : Initialize IPI locks.
  204. */
  205. static void __init init_ipi_lock(void)
  206. {
  207. int ipi;
  208. for (ipi = 0 ; ipi < NR_IPIS ; ipi++)
  209. spin_lock_init(&ipi_lock[ipi]);
  210. }
  211. /*==========================================================================*
  212. * Name: do_boot_cpu
  213. *
  214. * Description: This routine boot up one AP.
  215. *
  216. * Born on Date: 2002.02.05
  217. *
  218. * Arguments: phys_id - Target CPU physical ID
  219. *
  220. * Returns: void (cannot fail)
  221. *
  222. * Modification log:
  223. * Date Who Description
  224. * ---------- --- --------------------------------------------------------
  225. * 2003-06-24 hy modify for linux-2.5.69
  226. *
  227. *==========================================================================*/
  228. static void __init do_boot_cpu(int phys_id)
  229. {
  230. struct task_struct *idle;
  231. unsigned long send_status, boot_status;
  232. int timeout, cpu_id;
  233. cpu_id = ++cpucount;
  234. /*
  235. * We can't use kernel_thread since we must avoid to
  236. * reschedule the child.
  237. */
  238. idle = fork_idle(cpu_id);
  239. if (IS_ERR(idle))
  240. panic("failed fork for CPU#%d.", cpu_id);
  241. idle->thread.lr = (unsigned long)start_secondary;
  242. map_cpu_to_physid(cpu_id, phys_id);
  243. /* So we see what's up */
  244. printk("Booting processor %d/%d\n", phys_id, cpu_id);
  245. stack_start.spi = (void *)idle->thread.sp;
  246. task_thread_info(idle)->cpu = cpu_id;
  247. /*
  248. * Send Startup IPI
  249. * 1.IPI received by CPU#(phys_id).
  250. * 2.CPU#(phys_id) enter startup_AP (arch/m32r/kernel/head.S)
  251. * 3.CPU#(phys_id) enter start_secondary()
  252. */
  253. send_status = 0;
  254. boot_status = 0;
  255. cpu_set(phys_id, cpu_bootout_map);
  256. /* Send Startup IPI */
  257. send_IPI_mask_phys(cpumask_of_cpu(phys_id), CPU_BOOT_IPI, 0);
  258. Dprintk("Waiting for send to finish...\n");
  259. timeout = 0;
  260. /* Wait 100[ms] */
  261. do {
  262. Dprintk("+");
  263. udelay(1000);
  264. send_status = !cpu_isset(phys_id, cpu_bootin_map);
  265. } while (send_status && (timeout++ < 100));
  266. Dprintk("After Startup.\n");
  267. if (!send_status) {
  268. /*
  269. * allow APs to start initializing.
  270. */
  271. Dprintk("Before Callout %d.\n", cpu_id);
  272. cpu_set(cpu_id, cpu_callout_map);
  273. Dprintk("After Callout %d.\n", cpu_id);
  274. /*
  275. * Wait 5s total for a response
  276. */
  277. for (timeout = 0; timeout < 5000; timeout++) {
  278. if (cpu_isset(cpu_id, cpu_callin_map))
  279. break; /* It has booted */
  280. udelay(1000);
  281. }
  282. if (cpu_isset(cpu_id, cpu_callin_map)) {
  283. /* number CPUs logically, starting from 1 (BSP is 0) */
  284. Dprintk("OK.\n");
  285. } else {
  286. boot_status = 1;
  287. printk("Not responding.\n");
  288. }
  289. } else
  290. printk("IPI never delivered???\n");
  291. if (send_status || boot_status) {
  292. unmap_cpu_to_physid(cpu_id, phys_id);
  293. cpu_clear(cpu_id, cpu_callout_map);
  294. cpu_clear(cpu_id, cpu_callin_map);
  295. cpu_clear(cpu_id, cpu_initialized);
  296. cpucount--;
  297. }
  298. }
  299. int __cpuinit __cpu_up(unsigned int cpu_id)
  300. {
  301. int timeout;
  302. cpu_set(cpu_id, smp_commenced_mask);
  303. /*
  304. * Wait 5s total for a response
  305. */
  306. for (timeout = 0; timeout < 5000; timeout++) {
  307. if (cpu_isset(cpu_id, cpu_online_map))
  308. break;
  309. udelay(1000);
  310. }
  311. if (!cpu_isset(cpu_id, cpu_online_map))
  312. BUG();
  313. return 0;
  314. }
  315. void __init smp_cpus_done(unsigned int max_cpus)
  316. {
  317. int cpu_id, timeout;
  318. unsigned long bogosum = 0;
  319. for (timeout = 0; timeout < 5000; timeout++) {
  320. if (cpus_equal(cpu_callin_map, cpu_online_map))
  321. break;
  322. udelay(1000);
  323. }
  324. if (!cpus_equal(cpu_callin_map, cpu_online_map))
  325. BUG();
  326. for (cpu_id = 0 ; cpu_id < num_online_cpus() ; cpu_id++)
  327. show_cpu_info(cpu_id);
  328. /*
  329. * Allow the user to impress friends.
  330. */
  331. Dprintk("Before bogomips.\n");
  332. if (cpucount) {
  333. for_each_cpu_mask(cpu_id, cpu_online_map)
  334. bogosum += cpu_data[cpu_id].loops_per_jiffy;
  335. printk(KERN_INFO "Total of %d processors activated " \
  336. "(%lu.%02lu BogoMIPS).\n", cpucount + 1,
  337. bogosum / (500000 / HZ),
  338. (bogosum / (5000 / HZ)) % 100);
  339. Dprintk("Before bogocount - setting activated=1.\n");
  340. }
  341. }
  342. /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
  343. /* Activate a secondary processor Routins */
  344. /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
  345. /*==========================================================================*
  346. * Name: start_secondary
  347. *
  348. * Description: This routine activate a secondary processor.
  349. *
  350. * Born on Date: 2002.02.05
  351. *
  352. * Arguments: *unused - currently unused.
  353. *
  354. * Returns: void (cannot fail)
  355. *
  356. * Modification log:
  357. * Date Who Description
  358. * ---------- --- --------------------------------------------------------
  359. * 2003-06-24 hy modify for linux-2.5.69
  360. *
  361. *==========================================================================*/
  362. int __init start_secondary(void *unused)
  363. {
  364. cpu_init();
  365. preempt_disable();
  366. smp_callin();
  367. while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
  368. cpu_relax();
  369. smp_online();
  370. /*
  371. * low-memory mappings have been cleared, flush them from
  372. * the local TLBs too.
  373. */
  374. local_flush_tlb_all();
  375. cpu_idle();
  376. return 0;
  377. }
  378. /*==========================================================================*
  379. * Name: smp_callin
  380. *
  381. * Description: This routine activate a secondary processor.
  382. *
  383. * Born on Date: 2002.02.05
  384. *
  385. * Arguments: NONE
  386. *
  387. * Returns: void (cannot fail)
  388. *
  389. * Modification log:
  390. * Date Who Description
  391. * ---------- --- --------------------------------------------------------
  392. * 2003-06-24 hy modify for linux-2.5.69
  393. *
  394. *==========================================================================*/
  395. static void __init smp_callin(void)
  396. {
  397. int phys_id = hard_smp_processor_id();
  398. int cpu_id = smp_processor_id();
  399. unsigned long timeout;
  400. if (cpu_isset(cpu_id, cpu_callin_map)) {
  401. printk("huh, phys CPU#%d, CPU#%d already present??\n",
  402. phys_id, cpu_id);
  403. BUG();
  404. }
  405. Dprintk("CPU#%d (phys ID: %d) waiting for CALLOUT\n", cpu_id, phys_id);
  406. /* Waiting 2s total for startup (udelay is not yet working) */
  407. timeout = jiffies + (2 * HZ);
  408. while (time_before(jiffies, timeout)) {
  409. /* Has the boot CPU finished it's STARTUP sequence ? */
  410. if (cpu_isset(cpu_id, cpu_callout_map))
  411. break;
  412. cpu_relax();
  413. }
  414. if (!time_before(jiffies, timeout)) {
  415. printk("BUG: CPU#%d started up but did not get a callout!\n",
  416. cpu_id);
  417. BUG();
  418. }
  419. /* Allow the master to continue. */
  420. cpu_set(cpu_id, cpu_callin_map);
  421. }
  422. static void __init smp_online(void)
  423. {
  424. int cpu_id = smp_processor_id();
  425. local_irq_enable();
  426. /* Get our bogomips. */
  427. calibrate_delay();
  428. /* Save our processor parameters */
  429. smp_store_cpu_info(cpu_id);
  430. cpu_set(cpu_id, cpu_online_map);
  431. }
  432. /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
  433. /* Boot up CPUs common Routins */
  434. /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
  435. static void __init show_mp_info(int nr_cpu)
  436. {
  437. int i;
  438. char cpu_model0[17], cpu_model1[17], cpu_ver[9];
  439. strncpy(cpu_model0, (char *)M32R_FPGA_CPU_NAME_ADDR, 16);
  440. strncpy(cpu_model1, (char *)M32R_FPGA_MODEL_ID_ADDR, 16);
  441. strncpy(cpu_ver, (char *)M32R_FPGA_VERSION_ADDR, 8);
  442. cpu_model0[16] = '\0';
  443. for (i = 15 ; i >= 0 ; i--) {
  444. if (cpu_model0[i] != ' ')
  445. break;
  446. cpu_model0[i] = '\0';
  447. }
  448. cpu_model1[16] = '\0';
  449. for (i = 15 ; i >= 0 ; i--) {
  450. if (cpu_model1[i] != ' ')
  451. break;
  452. cpu_model1[i] = '\0';
  453. }
  454. cpu_ver[8] = '\0';
  455. for (i = 7 ; i >= 0 ; i--) {
  456. if (cpu_ver[i] != ' ')
  457. break;
  458. cpu_ver[i] = '\0';
  459. }
  460. printk(KERN_INFO "M32R-mp information\n");
  461. printk(KERN_INFO " On-chip CPUs : %d\n", nr_cpu);
  462. printk(KERN_INFO " CPU model : %s/%s(%s)\n", cpu_model0,
  463. cpu_model1, cpu_ver);
  464. }
  465. /*
  466. * The bootstrap kernel entry code has set these up. Save them for
  467. * a given CPU
  468. */
  469. static void __init smp_store_cpu_info(int cpu_id)
  470. {
  471. struct cpuinfo_m32r *ci = cpu_data + cpu_id;
  472. *ci = boot_cpu_data;
  473. ci->loops_per_jiffy = loops_per_jiffy;
  474. }
  475. static void __init show_cpu_info(int cpu_id)
  476. {
  477. struct cpuinfo_m32r *ci = &cpu_data[cpu_id];
  478. printk("CPU#%d : ", cpu_id);
  479. #define PRINT_CLOCK(name, value) \
  480. printk(name " clock %d.%02dMHz", \
  481. ((value) / 1000000), ((value) % 1000000) / 10000)
  482. PRINT_CLOCK("CPU", (int)ci->cpu_clock);
  483. PRINT_CLOCK(", Bus", (int)ci->bus_clock);
  484. printk(", loops_per_jiffy[%ld]\n", ci->loops_per_jiffy);
  485. }
  486. /*
  487. * the frequency of the profiling timer can be changed
  488. * by writing a multiplier value into /proc/profile.
  489. */
  490. int setup_profiling_timer(unsigned int multiplier)
  491. {
  492. int i;
  493. /*
  494. * Sanity check. [at least 500 APIC cycles should be
  495. * between APIC interrupts as a rule of thumb, to avoid
  496. * irqs flooding us]
  497. */
  498. if ( (!multiplier) || (calibration_result / multiplier < 500))
  499. return -EINVAL;
  500. /*
  501. * Set the new multiplier for each CPU. CPUs don't start using the
  502. * new values until the next timer interrupt in which they do process
  503. * accounting. At that time they also adjust their APIC timers
  504. * accordingly.
  505. */
  506. for (i = 0; i < NR_CPUS; ++i)
  507. per_cpu(prof_multiplier, i) = multiplier;
  508. return 0;
  509. }
  510. /* Initialize all maps between cpu number and apicids */
  511. static void __init init_cpu_to_physid(void)
  512. {
  513. int i;
  514. for (i = 0 ; i < NR_CPUS ; i++) {
  515. cpu_2_physid[i] = -1;
  516. physid_2_cpu[i] = -1;
  517. }
  518. }
  519. /*
  520. * set up a mapping between cpu and apicid. Uses logical apicids for multiquad,
  521. * else physical apic ids
  522. */
  523. static void __init map_cpu_to_physid(int cpu_id, int phys_id)
  524. {
  525. physid_2_cpu[phys_id] = cpu_id;
  526. cpu_2_physid[cpu_id] = phys_id;
  527. }
  528. /*
  529. * undo a mapping between cpu and apicid. Uses logical apicids for multiquad,
  530. * else physical apic ids
  531. */
  532. static void __init unmap_cpu_to_physid(int cpu_id, int phys_id)
  533. {
  534. physid_2_cpu[phys_id] = -1;
  535. cpu_2_physid[cpu_id] = -1;
  536. }