[U-Boot] [PATCH 08/22] x86: fsp: Mark memory used by U-Boot as reserved in the E820 table for S3

Bin Meng bmeng.cn at gmail.com
Wed Apr 12 08:14:12 UTC 2017


Hi Simon,

On Wed, Mar 22, 2017 at 4:06 AM, Simon Glass <sjg at chromium.org> wrote:
> Hi Bin,
>
> On 16 March 2017 at 08:26, Bin Meng <bmeng.cn at gmail.com> wrote:
>> U-Boot itself as well as everything that is consumed by U-Boot (like
>> heap, stack, dtb, etc) needs to be reserved and reported in the E820
>> table when S3 resume is on.
>>
>> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
>> ---
>>
>>  arch/x86/Kconfig            |  8 ++++++++
>>  arch/x86/lib/fsp/fsp_dram.c | 12 ++++++++++++
>>  2 files changed, 20 insertions(+)
>
> Reviewed-by: Simon Glass <sjg at chromium.org>
>
> Can you detect if the stack space is too small?
>
> It should be possible to measure the stack size easily enough - e.g.
> using cpu_get_sp().

I suspect we can fill the stack memory with some magic number, and
then after U-Boot boots to shell check the stack to see where the
pattern ends. This practice should be done periodically as U-Boot's
code base changes very rapidly.

Regards,
Bin


More information about the U-Boot mailing list