From: "Lendacky, Thomas" <thomas.lendacky@amd.com>
To: Laszlo Ersek <lersek@redhat.com>, devel@edk2.groups.io
Cc: Eric Dong <eric.dong@intel.com>, Ray Ni <ray.ni@intel.com>,
Rahul Kumar <rahul1.kumar@intel.com>,
Brijesh Singh <brijesh.singh@amd.com>,
Garrett Kirkendall <garrett.kirkendall@amd.com>
Subject: Re: [PATCH 1/1] UefiCpuPkg/MpInitLib: Reduce reset vector memory pressure
Date: Wed, 23 Sep 2020 10:50:43 -0500 [thread overview]
Message-ID: <a1dc5b2a-be7c-bd85-4d9c-22c46cc32911@amd.com> (raw)
In-Reply-To: <934ea92f-4e83-37ae-cf3d-a8e252bfa68e@amd.com>
On 9/23/20 8:58 AM, Tom Lendacky wrote:
> On 9/23/20 3:31 AM, Laszlo Ersek wrote:
>> On 09/23/20 10:14, Laszlo Ersek wrote:
>>
>>> (3) Even better... can you modify GetApResetVectorSize() to take
>>> &CpuMpData rather than &CpuMpData->AddressMap, and then check
>>> CpuMpData->SevEsIsEnabled?
>>>
>>> Hmmm, wait, that's not really simple, as we call GetApResetVectorSize()
>>> from MpInitLibInitialize() too, way before we set
>>> CpuMpData->SevEsIsEnabled from the PCD.
>>>
>>> So I guess we should pass a dedicated BOOLEAN parameter to
>>> GetApResetVectorSize(), called "SevEsIsEnabled". At the call site in
>>> MpInitLibInitialize(), we should pass in the PCD's value. At the call
>>> site in AllocateResetVector(), we should pass in
>>> CpuMpData->SevEsIsEnabled.
>>>
>>> The reason I'm suggesting (3) is that I don't feel comfortable with
>>> checking dynamic PCDs outside of entry point functions / initialization
>>> functions.
>>
>> You know what, never mind (3) -- I've just realized that
>> PcdCpuMaxLogicalProcessorNumber may be a dynamic PCD too. It might
>> require a lot of work to restrict all dynamic PCD accesses to the init
>> function only, and I couldn't necessarily justify all that work at the
>> moment (for myself or for anyone else).
>>
>> So please consider (1), (2) and (4).
>
> Yup, will do.
Re. #4, the code uses the APIC ID to calculate the stack start, so the
calculation, now in GetApResetVectorSize(), uses the full value of
PcdGet32(PcdCpuMaxLogicalProcessorNumber) instead of subtracting one from
it. I can always update MpInitLibSevEsAPReet() to subtract one from the
APIC ID value returned if we want to eliminate the extra 64 bytes.
Thanks,
Tom
>
> Thanks,
> Tom
>
>>
>> Thanks!
>> Laszlo
>>
prev parent reply other threads:[~2020-09-23 15:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-22 19:59 [PATCH 1/1] UefiCpuPkg/MpInitLib: Reduce reset vector memory pressure Lendacky, Thomas
2020-09-23 3:08 ` Ni, Ray
2020-09-23 8:14 ` Laszlo Ersek
2020-09-23 8:28 ` Laszlo Ersek
2020-09-23 8:31 ` Laszlo Ersek
2020-09-23 13:58 ` Lendacky, Thomas
2020-09-23 15:50 ` Lendacky, Thomas [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=a1dc5b2a-be7c-bd85-4d9c-22c46cc32911@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