• Will Deacon's avatar
    ARM: 8191/1: decompressor: ensure I-side picks up relocated code · 238962ac
    Will Deacon authored
    To speed up decompression, the decompressor sets up a flat, cacheable
    mapping of memory. However, when there is insufficient space to hold
    the page tables for this mapping, we don't bother to enable the caches
    and subsequently skip all the cache maintenance hooks.
    
    Skipping the cache maintenance before jumping to the relocated code
    allows the processor to predict the branch and populate the I-cache
    with stale data before the relocation loop has completed (since a
    bootloader may have SCTLR.I set, which permits normal, cacheable
    instruction fetches regardless of SCTLR.M).
    
    This patch moves the cache maintenance check into the maintenance
    routines themselves, allowing the v6/v7 versions to invalidate the
    I-cache regardless of the MMU state.
    
    Cc: <stable@vger.kernel.org>
    Reported-by: default avatarMarc Carino <marc.ceeeee@gmail.com>
    Tested-by: default avatarJulien Grall <julien.grall@linaro.org>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    238962ac
head.S 31.8 KB