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
stop_this_cpu() { while (1) { hlt() } }
Alternative #2, used on selected Intel Cores
stop_this_cpu() { 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.
Thanks, KM
we would need to track down the first appearance of the IPI code and try to figure out why it's there. I just don't recall.
ron