Architectural behavior of INIT/SIPI
Posted: Tue Mar 21, 2017 4:14 am
Hi,
while I have no trouble getting AP startup to work (on the somewhat modern PCs that I have available) I don't quite understand the architectural behavior of the INIT-SIPI-SIPI sequence. The MP Specification states that APs should be started (by the OS) via INIT-SIPI-SIPI. Brendan pointed out in earlier posts that some processors do not need a second SIPI so there is some room for optimization here.
As far as I understand the architectural behavior of INIT is resetting the processor (which includes resetting CS:IP to 0xFFFFFFF0) and executing the BIOS ROM code at this address. Is this correct?
After performing basic initialization the BIOS observes that the processor is an AP and enters a special wait-for-SIPI state (the way that is done does not seem to be architecturally defined?). The architectural behavior of SIPI is leaving the wait-for-SIPI state and setting IP to the page that is determined by the SIPI vector. Again: Is this understanding correct? If it is: Why do processors need two SIPIs at all? Is the second SIPI redundant and only necessary in case of a delivery failure? Are there processors that only exit wait-for-SIPI after two (correctly delivered) SIPIs?
Furthermore the MP Specification states that the OS should program the warm-reset vector and the CMOS shutdown code. It is not clear to me how this interacts with SIPIs and the BIOS boot code. At least on my machines a warm-reset is not necessary to bring up the APs. My hypothesis is that this startup via warm-reset is only meaningful on systems with a 82489DX APIC (as those systems do not support SIPIs) though that is not stated in the MP Specification. Are there non-82489DX systems that need the warm-reset? Does the BIOS enter wait-for-SIPI if the shutdown code is set to warm-reset? If so, is the SIPI vector ignored?
Thanks,
Alexander
while I have no trouble getting AP startup to work (on the somewhat modern PCs that I have available) I don't quite understand the architectural behavior of the INIT-SIPI-SIPI sequence. The MP Specification states that APs should be started (by the OS) via INIT-SIPI-SIPI. Brendan pointed out in earlier posts that some processors do not need a second SIPI so there is some room for optimization here.
As far as I understand the architectural behavior of INIT is resetting the processor (which includes resetting CS:IP to 0xFFFFFFF0) and executing the BIOS ROM code at this address. Is this correct?
After performing basic initialization the BIOS observes that the processor is an AP and enters a special wait-for-SIPI state (the way that is done does not seem to be architecturally defined?). The architectural behavior of SIPI is leaving the wait-for-SIPI state and setting IP to the page that is determined by the SIPI vector. Again: Is this understanding correct? If it is: Why do processors need two SIPIs at all? Is the second SIPI redundant and only necessary in case of a delivery failure? Are there processors that only exit wait-for-SIPI after two (correctly delivered) SIPIs?
Furthermore the MP Specification states that the OS should program the warm-reset vector and the CMOS shutdown code. It is not clear to me how this interacts with SIPIs and the BIOS boot code. At least on my machines a warm-reset is not necessary to bring up the APs. My hypothesis is that this startup via warm-reset is only meaningful on systems with a 82489DX APIC (as those systems do not support SIPIs) though that is not stated in the MP Specification. Are there non-82489DX systems that need the warm-reset? Does the BIOS enter wait-for-SIPI if the shutdown code is set to warm-reset? If so, is the SIPI vector ignored?
Thanks,
Alexander