From brettstahlman at gmail.com Fri Jul 15 12:11:22 2016 From: brettstahlman at gmail.com (Brett Stahlman) Date: Fri, 15 Jul 2016 11:11:22 -0500 Subject: [Fw_Os_Forum] Support for EFI MP Services Message-ID: I'm working on an x86_64 UEFI boot loader that runs on the BSP in 64-bit long mode, and must bring up APs (secondary processors) after some preliminary initialization. I've seen some documentation on EFI MP (multi-processor) Service Protocol, but the headers in gnu-efi don't appear to support it, and BS->LocateProtocol() reports status 14 (EFI_NOT_FOUND). My questions are... 1. Is there a way to add support for MP Services to firmware that doesn't have it natively? Is there a list somewhere documenting which firmware supports? 2. What is the best way to bring up the APs in an environment that doesn't support the MP Services Protocol? I've read something that suggests it might be easier with UEFI than with BIOS because the PI firmware does some pre-initialization of the APs even before handoff to the BSP - but I haven't found much documentation on this... Any help would be greatly appreciated. Thanks, Brett S. From Aaron.Pop at congatec.com Fri Jul 15 12:28:18 2016 From: Aaron.Pop at congatec.com (Aaron.Pop at congatec.com) Date: Fri, 15 Jul 2016 09:28:18 -0700 Subject: [Fw_Os_Forum] Support for EFI MP Services In-Reply-To: References: Message-ID: Hi Brett, >>1. Is there a way to add support for MP Services to firmware that doesn't have it natively? Is there a list somewhere documenting which firmware supports? If you platform doesn't support the MP services protocol, chances are that your platform is not compliant with the Platform Initialization specification. Additionally, the PI specification defines protocols that are intended for use by the firmware, not by boot loaders or the OS. I would highly recommend that your boot loader only use protocols that are defined in the UEFI specification. >>2. What is the best way to bring up the APs in an environment that doesn't support the MP Services Protocol? I've read something that suggests it might be easier with UEFI than with BIOS because the PI firmware does some pre-initialization of the APs even before handoff to the BSP - but I haven't found much documentation on this... X86/X86_64 operating systems follow intel's multi processor specification for waking APs when they are given control. ( http://download.intel.com/design/archives/processors/pro/docs/24201606.pdf ) All firmware (even legacy BIOSes) would initialize all processors in the system, and then would either halt the APs, or put the APs into a spin loop and only leave the BSP (boot strap processor) running when giving control to a bootloader. For more information, you can refer to http://wiki.osdev.org/Symmetric_Multiprocessing, or you can check out how the linux kernel performs multi processor bring up. -Aaron From: Brett Stahlman To: fw_os_forum at mailman.uefi.org Date: 07/15/2016 09:11 AM Subject: [Fw_Os_Forum] Support for EFI MP Services Sent by: fw_os_forum-bounces at mailman.uefi.org I'm working on an x86_64 UEFI boot loader that runs on the BSP in 64-bit long mode, and must bring up APs (secondary processors) after some preliminary initialization. I've seen some documentation on EFI MP (multi-processor) Service Protocol, but the headers in gnu-efi don't appear to support it, and BS->LocateProtocol() reports status 14 (EFI_NOT_FOUND). My questions are... 1. Is there a way to add support for MP Services to firmware that doesn't have it natively? Is there a list somewhere documenting which firmware supports? 2. What is the best way to bring up the APs in an environment that doesn't support the MP Services Protocol? I've read something that suggests it might be easier with UEFI than with BIOS because the PI firmware does some pre-initialization of the APs even before handoff to the BSP - but I haven't found much documentation on this... Any help would be greatly appreciated. Thanks, Brett S. _______________________________________________ Fw_os_forum mailing list Fw_os_forum at mailman.uefi.org http://lists.mailman.uefi.org/mailman/listinfo/fw_os_forum -------------- next part -------------- An HTML attachment was scrubbed... URL: From brettstahlman at gmail.com Fri Jul 15 15:27:02 2016 From: brettstahlman at gmail.com (Brett Stahlman) Date: Fri, 15 Jul 2016 14:27:02 -0500 Subject: [Fw_Os_Forum] Support for EFI MP Services In-Reply-To: References: Message-ID: Aaron, So methods like GetNumberOfProcessors and StartupAllAPs (documented here http://www.uefi.org/sites/default/files/resources/Plugfest_Multiprocessing-with_UEFI-McDaniel.pdf) are not meant to be called from a boot loader using Boot Services? I will have a look at the other references. Hopefully the firmware's AP initialization obviates the need for some of the tedious, low-level real mode trampoline code I've seen in the kernel and other loader code performing AP bring up... If UEFI simplifies only the BSP side of things, it doesn't seem a very complete solution... Thanks, Brett S. On Fri, Jul 15, 2016 at 11:28 AM, wrote: > Hi Brett, > >>>1. Is there a way to add support for MP Services to firmware that doesn't >>> have it natively? Is there a list somewhere documenting which firmware >>> supports? > If you platform doesn't support the MP services protocol, chances are that > your platform is not compliant with the Platform Initialization > specification. Additionally, the PI specification defines protocols that > are intended for use by the firmware, not by boot loaders or the OS. I would > highly recommend that your boot loader only use protocols that are defined > in the UEFI specification. > >>>2. What is the best way to bring up the APs in an environment that doesn't >>> support the MP Services Protocol? I've read something that suggests it might >>> be easier with UEFI than with BIOS because the PI firmware does some >>> pre-initialization of the APs even before handoff to the BSP - but I haven't >>> found much documentation on this... > X86/X86_64 operating systems follow intel's multi processor specification > for waking APs when they are given control. > (http://download.intel.com/design/archives/processors/pro/docs/24201606.pdf) > All firmware (even legacy BIOSes) would initialize all processors in the > system, and then would either halt the APs, or put the APs into a spin loop > and only leave the BSP (boot strap processor) running when giving control to > a bootloader. > > For more information, you can refer to > http://wiki.osdev.org/Symmetric_Multiprocessing, or you can check out how > the linux kernel performs multi processor bring up. > > -Aaron > > > > > > > From: Brett Stahlman > To: fw_os_forum at mailman.uefi.org > Date: 07/15/2016 09:11 AM > Subject: [Fw_Os_Forum] Support for EFI MP Services > Sent by: fw_os_forum-bounces at mailman.uefi.org > ________________________________ > > > > I'm working on an x86_64 UEFI boot loader that runs on the BSP in > 64-bit long mode, and must bring up APs (secondary processors) after > some preliminary initialization. I've seen some documentation on EFI > MP (multi-processor) Service Protocol, but the headers in gnu-efi > don't appear to support it, and BS->LocateProtocol() reports status 14 > (EFI_NOT_FOUND). My questions are... > > 1. Is there a way to add support for MP Services to firmware that > doesn't have it natively? Is there a list somewhere documenting which > firmware supports? > 2. What is the best way to bring up the APs in an environment that > doesn't support the MP Services Protocol? I've read something that > suggests it might be easier with UEFI than with BIOS because the PI > firmware does some pre-initialization of the APs even before handoff > to the BSP - but I haven't found much documentation on this... > > Any help would be greatly appreciated. > Thanks, > Brett S.