On Thu, 2014-10-23 at 07:28 +0000, Fan, Jeff wrote: 
> Chen,
> 
> Does CheckThisAPStatus() work now?

Yes, CheckThisAPStatus() seems to work ok. 
but I found gBS->SetTimer() seems not accurate. when I ran
StartCore.efi, I found sometimes I needed a long time to
wait for that case finished. I will investigate that.

And I had done a test cases list today. please see attached.
Unfortunately, StartupAllAPs works weak.


Thanks,
Chen


> 
> 
> -----Original Message-----
> From: Chen, Fan [mailto:[email protected]] 
> Sent: Wednesday, October 22, 2014 6:45 PM
> To: [email protected]
> Cc: Fan, Jeff; Jordan Justen
> Subject: Re: [edk2] [RFC PATCH v5 00/22] Introduce Mp Service protocol to 
> UefiCpuPkg
> 
> On Thu, 2014-10-16 at 01:48 +0000, Chen, Fan wrote: 
> > On Thu, 2014-10-16 at 01:32 +0000, Chen, Fan wrote: 
> > > On Wed, 2014-10-15 at 18:11 +0800, Chen Fan wrote: 
> > > > This series patchset try to implement Mp Service protocol in 
> > > > UefiCpuPkg, Jordan had implemented the startup APs code, and I try 
> > > > to add more initialization code to let all APs work up, this Mp 
> > > > Service protocol's implementation used EmulatorPkg/MpService for 
> > > > reference.
> > > > this patches works on my github:
> > > >   https://github.com/ChenFanFnst/edk2/tree/cpu-mp-service
> > > > 
> > > > v4-v5:
> > > >   1. introduce PcdCpuMaxLogicalProcessorNumber to pre-allocate
> > > >      stack buffer before starting the APs.
> > > >   2. reset AP by sending init ipi when StartupThisAP()/StartupAllAPs()
> > > >      timeout. but when BSP called CheckEvent/WaitForEvent, there will
> > > >      be caused BSP blocked. I made it in the last test patch, but I 
> > > >      can't find it out.
> > > I had a test code to check the function is right or not, my test 
> > > code
> > > is:
> > 
> > please ignore the previous mail that I sent by mistake. sorry for 
> > noise. ;)
> > 
> > I had made a test code to check the function is right or not, my test 
> > code was:
> > 
> > Status = MpService->StartupThisAP (MpService, ClientTask1, 1, 
> > WaitEvent, 1000, NULL, NULL); if (EFI_ERROR(Status)) {
> >      DEBUG ((DEBUG_ERROR, "FAILED.\n")); } do {
> >   Status = gBS->CheckEvent(WaitEvent); } while (EFI_ERROR(Status));
> > 
> > I found this code did not work, it would always do loop in CheckEvent, 
> > but in StartupThisAP(), I added a timer CheckThisAPStatus() to check 
> > the AP status. I expected that when timeout AP should be reset, but I 
> > found the timer seems not to work. what reason should be?
> > 
> I had added test codes for Mp Service Protocol to support verifying 
> StartupThisAP/StartupAllAPs with different parameters by modifying the 
> StartCorePkg. I had added them at: 
> https://github.com/ChenFanFnst/edk2/tree/startcore
> 
> Please help to review whether is ok.
> 
> Thanks,
> Chen
> 
> 
> > Thanks,
> > Chen
> > 
> > > 
> > > 
> > > 
> > > 
> > > >   3. some bug fix.
> > > > 
> > > > v3-v4:
> > > >   1. change the order of the patches.
> > > >   2. update some minor format suggested by Jeff.
> > > >   3. add a PCD value to configure StackSize.
> > > >   4. the last patch add assembly code for MSFT, but didn't
> > > >      test.
> > > > 
> > > > V3-V3.1:
> > > >   1. use AcquireSpinLockOrFail() intead of AcquireSpinLock()
> > > >      to avoid ASSERT sugguested by Jeff.
> > > > 
> > > > V2-V3:
> > > >   1. rebase codes due to Jordan'tree updated:
> > > >      https://github.com/jljusten/edk2/tree/ap-startup-example
> > > >   2. add supported on Ia32 arch
> > > >   3. add a new Lock to replace present SpinLock mechanisms in mutilple
> > > >      processors, maybe the SpinLock mechanisms is not MP safe.
> > > >   4. add function header
> > > >   5. add StartupAllAPs() supported
> > > >   6. add SwitchBSP() function, which is unsupported.
> > > > 
> > > > V1-V2:
> > > >   1. do not call anything EFI API from APs.
> > > >   2. add AP busy-wait for task assignment from BSP and get rid of
> > > >      IPI sent mechanism.
> > > > 
> > > > 
> > > > Chen Fan (17):
> > > >   UefiCpuPkg/CpuDxe: introduce two PCD value
> > > >   UefiCpuPkg/CpuDxe: Switch Ap Stack to NewStack
> > > >   UefiCpuPkg/CpuDxe: introduce EFI_MP_SERVICES_PROTOCOL
> > > >   UefiCpuPkg/CpuDxe: introduce MP_SYSTEM_DATA for Mp Service Protocol
> > > >   UefiCpuPkg/CpuDxe: implement Mp Protocol: WhoAmI()
> > > >   UefiCpuPkg/CpuDxe: implement Mp Protocol:GetNumberOfProcessors()
> > > >   UefiCpuPkg/CpuDxe: implement Mp Services:GetProcessorInfo()
> > > >   UefiCpuPkg/CpuDxe: implement Mp Protocol:EnableDisableAP()
> > > >   UefiCpuPkg/CpuDxe: implement Mp Protocol:StartupThisAP()
> > > >   UefiCpuPkg/CpuDxe: implement Mp Services:StartupAllAPs()
> > > >   UefiCpuPkg/CpuDxe: implement Mp Services:SwitchBSP()
> > > >   UefiCpuPkg/CpuDxe: Ap do loop routine to execute procedure
> > > >   UefiCpuPkg/CpuDxe: split out StartupCode from StartApsStackless()
> > > >   UefiCpuPkg/CpuDxe: introduce ResetApStackless()
> > > >   UefiCpuPkg/CpuDxe: Startup APs
> > > >   UefiCpuPkg/CpuDxe: install Mp Service protocol
> > > >   UefiCpuPkg/CpuDxe: add Mp Service TestCase (!upstream)
> > > > 
> > > > Jordan Justen (5):
> > > >   UefiCpuPkg/CpuDxe: Add no-op InitializeMpSupport
> > > >   UefiCpuPkg/CpuDxe: Add ApEntryPointInC
> > > >   UefiCpuPkg/CpuDxe: Add stackless assembly AP entry points
> > > >   UefiCpuPkg/CpuDxe: Move GDT structures into CpuGdt.h
> > > >   UefiCpuPkg/CpuDxe: Add StartApsStackless routine
> > > > 
> > > >  UefiCpuPkg/CpuDxe/ApStartup.asm   |  111 +++
> > > >  UefiCpuPkg/CpuDxe/ApStartup.c     |  252 +++++++
> > > >  UefiCpuPkg/CpuDxe/CpuDxe.c        |    5 +
> > > >  UefiCpuPkg/CpuDxe/CpuDxe.h        |    1 +
> > > >  UefiCpuPkg/CpuDxe/CpuDxe.inf      |   18 +
> > > >  UefiCpuPkg/CpuDxe/CpuGdt.c        |   52 +-
> > > >  UefiCpuPkg/CpuDxe/CpuGdt.h        |   72 ++
> > > >  UefiCpuPkg/CpuDxe/CpuMp.c         | 1446 
> > > > +++++++++++++++++++++++++++++++++++++
> > > >  UefiCpuPkg/CpuDxe/CpuMp.h         |  649 +++++++++++++++++
> > > >  UefiCpuPkg/CpuDxe/CpuMpTest.c     |   97 +++
> > > >  UefiCpuPkg/CpuDxe/Ia32/MpAsm.asm  |   75 ++
> > > >  UefiCpuPkg/CpuDxe/Ia32/MpAsm.nasm |   68 ++
> > > >  UefiCpuPkg/CpuDxe/X64/MpAsm.asm   |   76 ++
> > > >  UefiCpuPkg/CpuDxe/X64/MpAsm.nasm  |   70 ++
> > > >  UefiCpuPkg/UefiCpuPkg.dec         |    6 +
> > > >  UefiCpuPkg/UefiCpuPkg.dsc         |    1 +
> > > >  16 files changed, 2948 insertions(+), 51 deletions(-)  create 
> > > > mode 100644 UefiCpuPkg/CpuDxe/ApStartup.asm  create mode 100644 
> > > > UefiCpuPkg/CpuDxe/ApStartup.c  create mode 100644 
> > > > UefiCpuPkg/CpuDxe/CpuGdt.h  create mode 100644 
> > > > UefiCpuPkg/CpuDxe/CpuMp.c  create mode 100644 
> > > > UefiCpuPkg/CpuDxe/CpuMp.h  create mode 100644 
> > > > UefiCpuPkg/CpuDxe/CpuMpTest.c  create mode 100644 
> > > > UefiCpuPkg/CpuDxe/Ia32/MpAsm.asm  create mode 100644 
> > > > UefiCpuPkg/CpuDxe/Ia32/MpAsm.nasm  create mode 100644 
> > > > UefiCpuPkg/CpuDxe/X64/MpAsm.asm  create mode 100644 
> > > > UefiCpuPkg/CpuDxe/X64/MpAsm.nasm
> > > > 
> > > 
> > > --------------------------------------------------------------------
> > > ---------- Comprehensive Server Monitoring with Site24x7.
> > > Monitor 10 servers for $9/Month.
> > > Get alerted through email, SMS, voice calls or mobile push notifications.
> > > Take corrective actions from your mobile device.
> > > http://p.sf.net/sfu/Zoho
> > > _______________________________________________
> > > edk2-devel mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/edk2-devel
> > 
> > ----------------------------------------------------------------------
> > -------- Comprehensive Server Monitoring with Site24x7.
> > Monitor 10 servers for $9/Month.
> > Get alerted through email, SMS, voice calls or mobile push notifications.
> > Take corrective actions from your mobile device.
> > http://p.sf.net/sfu/Zoho
> > _______________________________________________
> > edk2-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/edk2-devel
> 

                       MP Service Protocol test case

---------------------------------------------------------------------------------------------------
 interface                    test case                      expected         
results         remarks
---------------------------------------------------------------------------------------------------
GetNumberOfProcessors                                             4             
  4            4 processors
---------------------------------------------------------------------------------------------------
GetProcessorInfo           each processor                 each cpuinfo      
each cpuinfo   
---------------------------------------------------------------------------------------------------
StartupAllAPs    block + APs reset after timeout              timout         
*BSP hung*
                 block + APs return before timeout            success           
 -             due to BSP hung
                 non-block + APs reset after timeout          timeout           
 -
                 non-block + APs return before timeout        success           
 -
---------------------------------------------------------------------------------------------------
StartupThisAP    block + AP reset after timeout               timeout          
timeout
                 block + AP return before timeout             success          
success
                 non-block + AP reset after timeout           timeout          
timeout
                 non-block + AP return before timeout         success          
success
---------------------------------------------------------------------------------------------------
SwitchBSP                        -                              -               
   -             unspported
---------------------------------------------------------------------------------------------------
EnableDisableAP                  -                              -               
   -               -
---------------------------------------------------------------------------------------------------
WhoAmI                    each processor                      0,1,2,3          
0,1,2,3           4 processors
---------------------------------------------------------------------------------------------------

*: failed case.
-: not test.
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to