• John David Anglin's avatar
    parisc: Purge TLB before setting PTE · 76d794a5
    John David Anglin authored
    commit c78e710c upstream.
    
    The attached change interchanges the order of purging the TLB and
    setting the corresponding page table entry.  TLB purges are strongly
    ordered.  It occurred to me one night that setting the PTE first might
    have subtle ordering issues on SMP machines and cause random memory
    corruption.
    
    A TLB lock guards the insertion of user TLB entries.  So after the TLB
    is purged, a new entry can't be inserted until the lock is released.
    This ensures that the new PTE value is used when the lock is released.
    
    Since making this change, no random segmentation faults have been
    observed on the Debian hppa buildd servers.
    Signed-off-by: default avatarJohn David Anglin  <dave.anglin@bell.net>
    Signed-off-by: default avatarHelge Deller <deller@gmx.de>
    [bwh: Backported to 3.16: adjust context]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    76d794a5
pgtable.h 18.3 KB