[edk2-devel] [PATCH v2 1/1] MdeModulePkg: Add MpServicesTest application to exercise MP Services

Rebecca Cran rebecca at nuviainc.com
Wed Nov 3 17:22:30 UTC 2021


Thanks. I have a couple of comments, but will otherwise send out a v2 
patch later today.


On 11/3/21 4:54 AM, Sami Mujawar wrote:
> On 20/09/2021 04:47 PM, Rebecca Cran via groups.io wrote:
>> +
>> +  for (Index = 0; Index < NumCpus; Index++) {
>> +    Status = Mp->GetProcessorInfo (Mp, Index, &CpuInfo);
>> +    ASSERT_EFI_ERROR (Status);
>> +    if ((CpuInfo.StatusFlag & PROCESSOR_ENABLED_BIT) &&
>> +        !(CpuInfo.StatusFlag & PROCESSOR_AS_BSP_BIT)) {
>> +      if (IndexOfEnabledCpuToUse == IndexOfEnabledCpu) {
>> +        *ProcessorIndex = Index;
>> +        Status = EFI_SUCCESS;
>> +        break;
> [SAMI] Minor. I think it should be possible to return from here. In 
> that case the check below if (Index == NumCpus) is not needed and 
> EFI_NOT_FOUND can be returned at the end of the function.

That's true, but I prefer to avoid returning from within loops like this.


>> +
>> +  for (Index = 1; Index < NumCpus; Index++) {
>> +    Print (L"Switching BSP to Processor %d with EnableOldBSP FALSE...", Index);
>> +    Status = Mp->SwitchBSP (Mp, Index, FALSE);
> [SAMI] The SwitchBsp call can only be performed by the current BSP. 
> So, I am not sure if this would work in a for loop.

That makes sense. I don't think there's a good way to test this then, so 
I'll remove the SwitchBsp tests.


-- 

Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#83282): https://edk2.groups.io/g/devel/message/83282
Mute This Topic: https://groups.io/mt/85744131/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20211103/22d69339/attachment.htm>


More information about the edk2-devel-archive mailing list