• Dan Handley's avatar
    Remove dcache invalidation after image authentication · ad4494dc
    Dan Handley authored
    At the end of successful image authentication in load_auth_image(),
    the data cache for the virtual address range corresponding to the
    image is invalidated (by a call to inv_dcache_range()). The intent
    seems to be to ensure the data caches do not contain any sensitive
    data used during authentication, which subsequent code can read.
    However, this same address range is already flushed (cleaned and
    invalidated by a call to flush_dcache_range()) at the end of
    load_image(), and the subsequent invalidate has no functional
    effect.
    
    This patch removes the redundant call to inv_dcache_range(). It
    also moves the flush_dcache_range() call from the end of load_image()
    to the end of load_auth_image(), so the image data will remain in
    the caches during authentication, improving performance.
    
    This also improves the comments that explain the rationale for
    calling flush_dcache_range() after image loading/authentication.
    
    Change-Id: I14f17ad2935075ef6f3d1327361c5088bfb2d284
    ad4494dc
bl_common.c 13.6 KB