[coreboot-gerrit] Patch merged into coreboot/master: 5d68622 elog: Correct behavior when FMAP section doesn't exist on ChromeOS

gerrit at coreboot.org gerrit at coreboot.org
Mon Apr 13 12:21:03 CEST 2015


the following patch was just integrated into master:
commit 5d686229e8f808c65934c17da9313e758b4ef9e9
Author: Julius Werner <jwerner at chromium.org>
Date:   Tue Jan 27 15:40:47 2015 -0800

    elog: Correct behavior when FMAP section doesn't exist on ChromeOS
    
    The elog driver has a really stupid bug that checks a result which is
    stored in an unsigned variable for < 0. Surprisingly GCC does not catch
    this nonsense right now, and I spent an hour trying out different
    warning options without finding one that doesn't also bring a load of
    stupid and unavoidable false positives (the biggest offender being
    -Wtype-limits, which does exactly what we'd want except for flagging
    things like if ((u8)var >= CONFIG_VAR_MIN) where the VAR_MIN Kconfig may
    or may not be 0).
    
    So, the only thing we can do is fix this one and wait for the next time
    something like that blows up. -.- Also change some more code to make the
    behavior more explicit (the old code already intended to work this way
    since flash_base is statically initialized to 0, never assigned in the
    error path and checked later in elog_init()... but there was an error
    message that incorrectly claimed a different fallback behavior, and
    explicitly assigning the values makes this easier to see). Finally, add
    another state to the elog_initialized variable to avoid trying to
    reinitialize a broken eventlog on every event (if it doesn't work the
    first time, chances are that it won't work later on during the same boot
    either).
    
    BRANCH=None
    BUG=chrome-os-partner:35940
    TEST=Flashed Jerry with RO 6588.4 and RW 6588.23, observed how it now
    cleanly enters recovery mode without blowing its bootblock away with
    stray eventlog entries.
    
    Change-Id: I0e5348ba961ce4835c30f7108a2453522095f2ee
    Signed-off-by: Stefan Reinauer <reinauer at chromium.org>
    Original-Commit-Id: f9798dbf0c2b2e337062ecd84d0f45434343c0d9
    Original-Change-Id: I4d93f48d2d01d75a04550d419e023aa42ca95a7a
    Original-Signed-off-by: Julius Werner <jwerner at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/243671
    Original-Reviewed-by: Duncan Laurie <dlaurie at chromium.org>
    Reviewed-on: http://review.coreboot.org/9557
    Tested-by: build bot (Jenkins)
    Reviewed-by: Julius Werner <jwerner at chromium.org>
    Reviewed-by: Patrick Georgi <pgeorgi at google.com>


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

-gerrit



More information about the coreboot-gerrit mailing list