From: "Lendacky, Thomas" <thomas.lendacky@amd.com>
To: Laszlo Ersek <lersek@redhat.com>, devel@edk2.groups.io
Cc: Brijesh Singh <brijesh.singh@amd.com>,
Eric Dong <eric.dong@intel.com>, Ray Ni <ray.ni@intel.com>,
Rahul Kumar <rahul1.kumar@intel.com>
Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/MpInitLib: Allocate a separate SEV-ES AP reset stack area
Date: Fri, 14 May 2021 09:54:23 -0500 [thread overview]
Message-ID: <4b3d5b75-f020-59ca-37c5-50b754831007@amd.com> (raw)
In-Reply-To: <5d7133d0-d933-a5d3-af0c-e21275d78176@amd.com>
On 5/14/21 8:33 AM, Tom Lendacky wrote:
> On 5/14/21 4:14 AM, Laszlo Ersek wrote:
>> On 05/11/21 22:50, Lendacky, Thomas wrote:
>>> BZ: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3324&data=04%7C01%7Cthomas.lendacky%40amd.com%7C7c28b41e27cc4b9a8b9508d916b8a955%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637565804655837525%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Ixw2PdtFLryJs9KHplJ8bvomtaqjBJF8KuDdWO5ERdw%3D&reserved=0
>>>
...
>>
>>> @@ -220,11 +222,11 @@ GetWakeupBuffer (
>>> // Need memory under 1MB to be collected here
>>> //
>>> WakeupBufferEnd = Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->ResourceLength;
>>> - if (WakeupBufferEnd > BASE_1MB) {
>>> + if (WakeupBufferEnd > mWakeupBuffer) {
>>> //
>>> - // Wakeup buffer should be under 1MB
>>> + // Wakeup buffer should be under 1MB and under the previous one
>>> //
>>> - WakeupBufferEnd = BASE_1MB;
>>> + WakeupBufferEnd = mWakeupBuffer;
>>> }
>>> while (WakeupBufferEnd > WakeupBufferSize) {
>>> //
>>
>> (7) Can we use a WakeupBufferLimit helper variable here, and set it like
>> "StartAddress" under (2)?
>
> Will do.
Actually, WakeupBufferEnd is like a helper variable here, so probably best
to just do:
if (PcdGetBool (PcdSevEsIsEnabled) &&
WakeupBufferEnd > mSevEsPeiWakeupBuffer) {
//
// SEV-ES Wakeup buffer should be under 1MB and under any previous one
//
WakeupBufferEnd = mSevEsPeiWakeupBuffer;
} else if (WakeupBufferEnd > BASE_1MB) {
//
// Wakeup buffer should be under 1MB
//
WakeupBufferEnd = BASE_1MB;
}
which makes for a nice diff:
@@ -220,7 +222,13 @@ GetWakeupBuffer (
// Need memory under 1MB to be collected here
//
WakeupBufferEnd = Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->ResourceLength;
- if (WakeupBufferEnd > BASE_1MB) {
+ if (PcdGetBool (PcdSevEsIsEnabled) &&
+ WakeupBufferEnd > mSevEsPeiWakeupBuffer) {
+ //
+ // SEV-ES Wakeup buffer should be under 1MB and under any previous one
+ //
+ WakeupBufferEnd = mSevEsPeiWakeupBuffer;
+ } else if (WakeupBufferEnd > BASE_1MB) {
//
// Wakeup buffer should be under 1MB
//
Thanks,
Tom
>
>>
next prev parent reply other threads:[~2021-05-14 14:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-11 20:50 [PATCH] UefiCpuPkg/MpInitLib: Allocate a separate SEV-ES AP reset stack area Lendacky, Thomas
2021-05-14 9:14 ` [edk2-devel] " Laszlo Ersek
2021-05-14 13:33 ` Lendacky, Thomas
2021-05-14 14:54 ` Lendacky, Thomas [this message]
2021-05-14 15:04 ` Marvin Häuser
2021-05-14 15:23 ` Lendacky, Thomas
2021-05-14 15:44 ` Marvin Häuser
2021-05-16 1:17 ` Laszlo Ersek
2021-05-16 22:15 ` Marvin Häuser
2021-05-18 15:29 ` Laszlo Ersek
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=4b3d5b75-f020-59ca-37c5-50b754831007@amd.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