On 02/03/2015 10:51 PM, Jordan Justen wrote: > On 2015-02-03 00:07:20, Fan, Jeff wrote: >> Jordan is right. NMI exception handler may be hooked by platform to capture >> real NMI interrupt. >> >> I suggest to send SIPI to Aps to wakeup AP if AP is in hlt state. >> But Aps needs startup from real mode. > Yes, we could go back to SIPI if needed. I think SIPI would have 2 > disadvantages: > * Re-allocate real-mode memory and setup real-mode code > * It would take longer > > But, SIPI would also have two advantages: > * Guarantee getting control of the AP even if the AP was left in a bad > state where interrupts might not work > * Easier to implement (no complication of a separate AP interrupt > vector table.) > > -Jordan Jordan & Jeff,
Sorry for reply so late. I has remade my patches to use SIPI to wakeup AP. and Sent out the v2 patches. PLS help to review. Thanks, Chen >> -----Original Message----- >> From: Justen, Jordan L >> Sent: Saturday, January 31, 2015 4:36 AM >> To: Chen Fan; edk2-devel@lists.sourceforge.net >> Cc: Fan, Jeff >> Subject: Re: [PATCH 2/4] UefiCpuPkg/MpService: register NMI handler for wake >> up AP with hlt state >> >> On 2015-01-29 23:54:44, Chen Fan wrote: >>> Contributed-under: TianoCore Contribution Agreement 1.0 >>> Signed-off-by: Chen Fan <chen.fan.f...@cn.fujitsu.com> >>> --- >>> UefiCpuPkg/CpuDxe/CpuMp.c | 31 +++++++++++++++++++++++++++++++ >>> 1 file changed, 31 insertions(+) >>> >>> diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c >>> index 71b62be..94b72b7 100644 >>> --- a/UefiCpuPkg/CpuDxe/CpuMp.c >>> +++ b/UefiCpuPkg/CpuDxe/CpuMp.c >>> @@ -1488,6 +1488,30 @@ ExitBootServicesCallback ( } >>> >>> /** >>> + Specify NMI interruptHandler. >>> + >>> + @param InterruptType Defines the type of interrupt or exception that >>> + occurred on the processor.This parameter is >>> processor architecture specific. >>> + @param SystemContext A pointer to the processor context when >>> + the interrupt occurred on the processor. >>> + >>> +**/ >>> +VOID >>> +EFIAPI >>> +NMIInterruptHandler ( >>> + IN EFI_EXCEPTION_TYPE InterruptType, >>> + IN EFI_SYSTEM_CONTEXT SystemContext >>> + ) >>> +{ >>> + // >>> + // NMI interrupt handler only for wake up AP with hlt state, >>> + // so here no routine. >>> + // >>> + return; >>> +} >>> + >>> + >>> +/** >>> Initialize Multi-processor support. >>> >>> **/ >>> @@ -1497,6 +1521,7 @@ InitializeMpSupport ( >>> ) >>> { >>> EFI_STATUS Status; >>> + EFI_CPU_ARCH_PROTOCOL *Cpu; >>> >>> gMaxLogicalProcessorNumber = (UINTN) PcdGet32 >>> (PcdCpuMaxLogicalProcessorNumber); >>> if (gMaxLogicalProcessorNumber < 1) { @@ -1540,6 +1565,12 @@ >>> InitializeMpSupport ( >>> sizeof (CPU_DATA_BLOCK) * >>> mMpSystemData.NumberOfProcessors, >>> mMpSystemData.CpuDatas); >>> >>> + /* Register NMI interrupt handler */ Status = gBS->LocateProtocol >>> + (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&Cpu); ASSERT_EFI_ERROR >>> + (Status); Status = Cpu->RegisterInterruptHandler (Cpu, 2, >>> + NMIInterruptHandler); >> I think we need to install a separate interrupt table for the APs. >> >> This is public interface, so other code could redirect this handler. >> >> Also, I think this is an implementation detail for APs that should not cause >> the interrupt handler to be changed on the main processor. >> >> -Jordan >> >>> + ASSERT_EFI_ERROR (Status); >>> + >>> mAPsAlreadyInitFinished = TRUE; >>> >>> Status = gBS->InstallMultipleProtocolInterfaces ( >>> -- >>> 1.9.3 >>> > . > ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel