[coreboot-gerrit] Patch merged into coreboot/master: d6b16f5 Set armv7 up for cpu_info to work as on x86 (so threads can work)

gerrit at coreboot.org gerrit at coreboot.org
Wed Aug 6 22:07:08 CEST 2014


the following patch was just integrated into master:
commit d6b16f54b9c34a8095a3eefbaf334150c15cecb5
Author: Ronald G. Minnich <rminnich at gmail.com>
Date:   Fri Aug 16 15:57:56 2013 -0700

    Set armv7 up for cpu_info to work as on x86 (so threads can work)
    
    On x86, cpu_info lives at the top of stack. Make the arm do that as
    well, as the threading model needs that and so will multicore support.
    
    As part of this change, make the stack size a power of 2.
    Also make it much smaller -- 2048 bytes is PLENTY for ram stage.
    
    Note that the small stack size is counterintuitive for rom stage.  How
    can this work in rom stage, which needs a HUGE stack for lzma? The
    main use of STACK_SIZE has always been in ram stage; since 2002 or so
    it was to size per-core stacks (see, e.g.,
    
    src/arch/x86/lib/c_start.S:.space CONFIG_MAX_CPUS*CONFIG_STACK_SIZE
    
    and, more recently, thread stacks. So, we define the STACK_TOP for rom
    and ram stage, but the STACK_SIZE has no real effect on the ROM stage
    (no hardware red zones on the stack) and hence we're ok with actually
    defining the "wrong" stack size. In fact, the coreboot_ram ldscript
    for armv7 sizes the stack by subtracting CONFIG_STACK_BOTTOM from
    CONFIG_STACK_TOP, so we replicate that arithmetic in bootblock.inc
    
    Observed stack usage in ramstage:
    BS: BS_PAYLOAD_LOAD times (us): entry 1 run 153887 exit 1
    Jumping to boot code at 23104044
    CPU0: stack: 02072800 - 02073000, lowest used address 020728d4, stack used: 1836 bytes
    entry    = 23104044
    
    Which means we do need 2K, not 1K.
    
    Change-Id: I1a21db87081597efe463095bfd33c89eba1d569f
    Signed-off-by: Ronald G. Minnich <rminnich at gmail.com>
    Reviewed-on: https://gerrit.chromium.org/gerrit/66135
    Reviewed-by: Ronald G. Minnich <rminnich at chromium.org>
    Tested-by: Ronald G. Minnich <rminnich at chromium.org>
    Commit-Queue: Ronald G. Minnich <rminnich at chromium.org>
    (cherry picked from commit f011097e9f2bfb2f4c1109d465be89a79a65ba3e)
    Signed-off-by: Isaac Christensen <isaac.christensen at se-eng.com>
    Reviewed-on: http://review.coreboot.org/6501
    Tested-by: build bot (Jenkins)
    Reviewed-by: David Hendricks <dhendrix at chromium.org>
    Reviewed-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
    Reviewed-by: Paul Menzel <paulepanter at users.sourceforge.net>


See http://review.coreboot.org/6501 for details.

-gerrit



More information about the coreboot-gerrit mailing list