[coreboot] SMP stop_this_cpu and AP_IN_SIPI_WAIT

Kyösti Mälkki kyosti.malkki at gmail.com
Sat Mar 10 10:21:33 CET 2012

There are currently two different versions of stop_this_cpu() used to
halt an AP CPU after init and microcode update.

Alternative #1, the default

  while (1) { hlt() }

Alternative #2, used on selected Intel Cores

  send INIT IPI message to self

  /* should not reach here */
  while (1) { hlt() }

I would like to know the reasoning for implementing #2. Was this a
solution to an observed problem? The commentary speaks about
hyper-threading, while the processor models with the AP_IN_SIPI_WAIT
enabled are really multi-core.

I believe alternative #1 one is not sufficient for any SMP platform. If
an exception raises and the AP CPU has NULL IDT, a hyper-threading CPU
may shutdown its sibling CPUs in the same physical package. If there is
a valid IDT and the exception handler returns, memory at CS:EIP may no
longer contain the hlt() loop.


More information about the coreboot mailing list