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 v4] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time
Date: Thu, 5 Dec 2019 06:09:32 +0000 [thread overview]
Message-ID: <ED077930C258884BBCB450DB737E662259F62A26@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C39021F@SHSMSX104.ccr.corp.intel.com>
Hi Ray,
> -----Original Message-----
> From: Ni, Ray
> Sent: Thursday, December 5, 2019 1:25 PM
> To: Dong, Eric <eric.dong@intel.com>; devel@edk2.groups.io
> Cc: Laszlo Ersek <lersek@redhat.com>
> Subject: RE: [PATCH v4] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate
> Token every time
>
> Some comments.
> > + //
> >
> > + // Not free the buffer, just clear the UsedTokenNum. In order to
> >
> > + // avoid triggering allocate action when we need to use the token,
> >
> > + // do not free the buffer.
> 1. Can you reword to below?
> "Only free the token buffer recorded in the OldTOkenBufList upon exiting
> SMI.
> Current token buffer stays allocated so next SMI doesn't need to re-
> allocate."
[[Eric]] will change to this in next version.
>
> > + ASSERT_EFI_ERROR (TokenCountPerChunk != 0);
>
> 2. This is not right. Should use ASSERT().
[[Eric]] Will update in next version.
>
> > + DEBUG ((DEBUG_INFO, "CpuSmm: SpinLock Size = 0x%x,
> > PreAllocateTokenNum = 0x%x\n", SpinLockSize, TokenCountPerChunk));
>
> 3. "PreAllocateTokenNum" -> "PcdTokenCountPerChunk". Please directly
> use the PCD name in debug log.
[[Eric]] will update it in next version.
>
> >
> > + UINT8 *CurrentTokenBuf;
> >
> > + UINTN UsedTokenNum; // Only record tokens used in
> > CurrentTokenBuf.
>
> 4. I see a mismatch between types of UsedTokenNum and the PCD. One is
> UINTN, the other is UINT32.
> Better to use UINT32 here.
[[Eric]] will use UINT32 in next version.
>
> >
> gUefiCpuPkgTokenSpaceGuid.PcdTokenCountPerChunk|64|UINT32|0x3000
> 2002
>
> 5. The PCD name is too generic. It's hard to tell when/where the PCD is used
> by reading the name only.
> Maybe "PcdCpuSmmMpTokenCountPerChunk"?
[[Eric]] will use this name in next version.
>
> > +#string
> > STR_gUefiCpuPkgTokenSpaceGuid_PcdTokenCountPerChunk_PROMPT
> > #language en-US "Specify the size of pre allocated token count per
> chunk.\n"
>
> 6. "Size of pre allocated token count per chunk" is a bit confusing.
> How about "Count of pre allocated SMM MP tokens"?
[[Eric]] will update to "Count of pre allocated SMM MP tokens per chunk "
> Then maybe the PCD name can be "PcdCpuSmmMpPreAllocateTokenCount"?
[[Eric]] I think " PcdCpuSmmMpTokenCountPerChunk " is better and will use it.
Thanks,
Eric
>
> Thanks,
> Ray
prev parent reply other threads:[~2019-12-05 6:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-05 1:50 [PATCH v4] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time Dong, Eric
2019-12-05 5:24 ` Ni, Ray
2019-12-05 6:09 ` 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=ED077930C258884BBCB450DB737E662259F62A26@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