• John David Anglin's avatar
    parisc: Prevent TLB speculation on flushed pages on CPUs that only support equivalent aliases · 40b20d4e
    John David Anglin authored
    commit ae7a609c upstream.
    
    Helge noticed that we flush the TLB page in flush_cache_page but not in
    flush_cache_range or flush_cache_mm.
    
    For a long time, we have had random segmentation faults building
    packages on machines with PA8800/8900 processors.  These machines only
    support equivalent aliases.  We don't see these faults on machines that
    don't require strict coherency.  So, it appears TLB speculation
    sometimes leads to cache corruption on machines that require coherency.
    
    This patch adds TLB flushes to flush_cache_range and flush_cache_mm when
    coherency is required.  We only flush the TLB in flush_cache_page when
    coherency is required.
    
    The patch also optimizes flush_cache_range.  It turns out we always have
    the right context to use flush_user_dcache_range_asm and
    flush_user_icache_range_asm.
    
    The patch has been tested for some time on rp3440, rp3410 and A500-44.
    It's been boot tested on c8000.  No random segmentation faults were
    observed during testing.
    Signed-off-by: default avatarJohn David Anglin <dave.anglin@bell.net>
    Signed-off-by: default avatarHelge Deller <deller@gmx.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    40b20d4e
cache.c 16.8 KB