From: "Dong, Eric" <eric.dong@intel.com>
To: "Ni, Ray" <ray.ni@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Laszlo Ersek <lersek@redhat.com>
Subject: Re: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Remove dependence between APs.
Date: Mon, 23 Dec 2019 06:58:51 +0000 [thread overview]
Message-ID: <ED077930C258884BBCB450DB737E662259F6BBC2@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C3A3FA1@SHSMSX104.ccr.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 2321 bytes --]
Hi Ray,
> -----Original Message-----
> From: Ni, Ray
> Sent: Friday, December 20, 2019 2:15 PM
> To: Dong, Eric <eric.dong@intel.com<mailto:eric.dong@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> Cc: Laszlo Ersek <lersek@redhat.com<mailto:lersek@redhat.com>>
> Subject: RE: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Remove dependence
> between APs.
>
> >
> > + if (!Token->SingleAp) {
> >
> > + ReleaseSemaphore (&Token->FinishedApCount);
>
> 1. If the FinishedApCount is renamed to RunningApCount and
> InterlockedDecrement() is called for it.
>
> SingleAp flag is unneeded.
>
> For StartupAllAps(), RunningApCount = mMaxNumberOfCpus - 1; For
> StartupThisAps(), RunningApCount = 1;
>
> When RunningApCount == 0, the spinlock is released.
>
[[Eric]] good idea, will update the logic.
> > + if (mSmmMpSyncData->CpuData[CpuIndex].Token != NULL) {
> >
> > + ReleaseToken (CpuIndex);
>
> 2. Can you directly pass in mSmmMpSyncData->CpuData[CpuIndex].Token?
> It simplifies the ReleaseToken() and also make people understand that
> ReleaseToken() will only modifies the Token but other states in
> CpuData[Index] is NOT changed.
>
[[Eric]] ReleaseToken also set mSmmMpSyncData->CpuData[CpuIndex].Token to NULL
at the end. So can't directly input Token.
> >
> > @@ -1170,10 +1120,12 @@ CreateToken (
>
> 3. With the comment #1, CreateToken() can carry additional parameter which
> specifies the RunningApCount.
>
[[Eric]] yes, will update the logic.
> > ASSERT (ProcToken != NULL);
> >
> > ProcToken->Signature = PROCEDURE_TOKEN_SIGNATURE;
> >
> > ProcToken->ProcedureToken = CpuToken;
>
> 4. ProcToken->ProcedureToken looks a bit strange.
> Can we use "ProcToken->Spinlock"?
[[Eric]] yes, will update the name.
Thanks,
Eric
>
> >
> > + *Token = (MM_COMPLETION) mSmmMpSyncData-
> > >CpuData[CpuIndex].Token->ProcedureToken;
>
> 5. It will become
> *Token = (MM_COMPLETION) mSmmMpSyncData-
> >CpuData[CpuIndex].Token->Spinlock;
>
> >
> > + ReleaseSemaphore (&ProcToken->FinishedApCount);
>
> 6. I can now understand why "FinishedApCount is directly compared against
> mMaxNumberOfCpus because the FinishedApCount is already increased for
> BSP. It's not a comment for code change.
>
>
> Thanks,
> Ray
[-- Attachment #2: Type: text/html, Size: 8734 bytes --]
prev parent reply other threads:[~2019-12-23 6:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-20 5:34 [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Remove dependence between APs Dong, Eric
2019-12-20 6:15 ` Ni, Ray
2019-12-23 6:58 ` Dong, Eric [this message]
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=ED077930C258884BBCB450DB737E662259F6BBC2@shsmsx102.ccr.corp.intel.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