<div dir="ltr">It is better to review the pcengines apu1 boot code--pay attention on any function that uses >= 64B stack storage<div>(function arguments and local variables).  Try reduce the stack size of such functions instead of increasing the STACK_SIZE.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 10, 2015 at 7:02 AM, Aaron Durbin <span dir="ltr"><<a href="mailto:adurbin@google.com" target="_blank">adurbin@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Sun, Sep 6, 2015 at 9:10 AM, Maxime de Roucy<br>
<<a href="mailto:maxime.deroucy@gmail.com">maxime.deroucy@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> I am building a coreboot rom for my pcengines apu1.<br>
> A bug is logged during the boot process :<br>
> <a href="http://review.coreboot.org/gitweb?p=board-status.git;a=blob;f=pcengines/apu1/4.0-9873-g7b9762f/2015-06-04T15:16:28Z/coreboot_console.txt;hb=HEAD#l1281" rel="noreferrer" target="_blank">http://review.coreboot.org/gitweb?p=board-status.git;a=blob;f=pcengines/apu1/4.0-9873-g7b9762f/2015-06-04T15:16:28Z/coreboot_console.txt;hb=HEAD#l1281</a><br>
><br>
> In order to solve it I applied this changed :<br>
><br>
>     diff --git a/src/Kconfig b/src/Kconfig<br>
>     index 9c01687..c8b8ad2 100644<br>
>     --- a/src/Kconfig<br>
>     +++ b/src/Kconfig<br>
>     @@ -427,7 +427,7 @@ config HEAP_SIZE<br>
>      config STACK_SIZE<br>
>             hex<br>
>             default 0x0 if (ARCH_RAMSTAGE_ARM || ARCH_RAMSTAGE_MIPS || ARCH_RAMSTAGE_RISCV)<br>
>     -       default 0x1000<br>
>     +       default 0x2000<br>
><br>
>      config MAX_CPUS<br>
>             int<br>
><br>
> I don't see the bug line anymore, instead I see :<br>
><br>
>     CPU0: stack: 00148000 - 0014a000, lowest used address 00148d34, stack used: 4812 bytes<br>
><br>
> I now the patch is not good since it change the default stack size for<br>
> all the boards. I didn't found the right place the change the stack<br>
> size only for pcengines apu1 board.<br>
> But maybe those informations can help developers to improve coreboot.<br>
<br>
</div></div>That's quite the stack usage.  It'd be interesting to know what's<br>
using all that stack. Could you apply this patch and run w/ it? It'd<br>
help narrow down at what point in the boot where the stack gets used<br>
up. Also, that you used 4812 bytes just means you overwrote the other<br>
CPU's stack at some point when STACK_SIZE == 4KiB.<br>
<br>
<br>
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c<br>
index b3c0c35..8a241b2 100644<br>
--- a/src/lib/hardwaremain.c<br>
+++ b/src/lib/hardwaremain.c<br>
@@ -378,6 +378,8 @@ static void bs_walk_state_machine(void)<br>
                bs_report_time(state);<br>
<br>
                state->complete = 1;<br>
+<br>
+               checkstack(_estack, 0);<br>
<div class="HOEnZb"><div class="h5">        }<br>
 }<br>
<br>
<br>
> --<br>
> Regards<br>
> Maxime de Roucy<br>
</div></div><span class="HOEnZb"><font color="#888888">> --<br>
> coreboot mailing list: <a href="mailto:coreboot@coreboot.org">coreboot@coreboot.org</a><br>
> <a href="http://www.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">http://www.coreboot.org/mailman/listinfo/coreboot</a><br>
<br>
--<br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org">coreboot@coreboot.org</a><br>
<a href="http://www.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">http://www.coreboot.org/mailman/listinfo/coreboot</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><span style="color:rgb(85,85,85);font-family:sans-serif;font-size:small;line-height:19.5px;border-width:2px 0px 0px;border-style:solid;border-color:rgb(213,15,37);padding-top:2px;margin-top:2px">Sheng-Liang Song |</span><span style="color:rgb(85,85,85);font-family:sans-serif;font-size:small;line-height:19.5px;border-width:2px 0px 0px;border-style:solid;border-color:rgb(51,105,232);padding-top:2px;margin-top:2px"> Software Engineer |</span><span style="color:rgb(85,85,85);font-family:sans-serif;font-size:small;line-height:19.5px;border-width:2px 0px 0px;border-style:solid;border-color:rgb(0,153,57);padding-top:2px;margin-top:2px"> <a href="mailto:ssl@google.com" target="_blank">ssl@google.com</a> |</span><span style="color:rgb(85,85,85);font-family:sans-serif;font-size:small;line-height:19.5px;border-width:2px 0px 0px;border-style:solid;border-color:rgb(238,178,17);padding-top:2px;margin-top:2px"> 650-537-5017</span><br></div></div>
</div>