public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Rebecca Cran" <rebecca@nuviainc.com>
To: Sami Mujawar <sami.mujawar@arm.com>,
	devel@edk2.groups.io, Jian J Wang <jian.j.wang@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>, nd <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: Add MpServicesTest application to exercise MP Services
Date: Wed, 3 Nov 2021 11:22:30 -0600	[thread overview]
Message-ID: <d340e9d2-aabf-a6c2-d01a-27305942b811@nuviainc.com> (raw)
In-Reply-To: <2c02b1f0-377f-4c4f-5b9b-cfd80f6a9058@arm.com>

[-- Attachment #1: Type: text/plain, Size: 1335 bytes --]

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


[-- Attachment #2: Type: text/html, Size: 2295 bytes --]

  reply	other threads:[~2021-11-03 17:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20 15:47 [PATCH v2 0/1] MdeModulePkg: Add MpServicesTest.efi to exercise EFI_MP_SERVICES_PROTOCOL Rebecca Cran
2021-09-20 15:47 ` [PATCH v2 1/1] MdeModulePkg: Add MpServicesTest application to exercise MP Services Rebecca Cran
2021-11-03 10:54   ` [edk2-devel] " Sami Mujawar
2021-11-03 17:22     ` Rebecca Cran [this message]
     [not found] ` <16A69264F30D2680.28782@groups.io>
2021-10-16  6:32   ` Rebecca Cran
2021-10-16  6:54     ` Sami Mujawar
2021-11-03  2:31       ` Rebecca Cran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d340e9d2-aabf-a6c2-d01a-27305942b811@nuviainc.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox