• Benjamin Herrenschmidt's avatar
    powerpc/mm: Fix bugs in huge page hashing · 171aa2ca
    Benjamin Herrenschmidt authored
    There's a couple of nasty bugs lurking in our huge page hashing code.
    
    First, we don't check the access permission atomically with setting
    the _PAGE_BUSY bit, which means that the PTE value we end up using
    for the hashing might be different than the one we have checked
    the access permissions for.
    
    We've seen cases where that leads us to try to use an invalidated
    PTE for hashing, causing all sort of "interesting" issues.
    
    Then, we also failed to set _PAGE_DIRTY on a write access.
    
    Finally, a minor tweak but we should return 0 when we find the
    PTE busy, in order to just re-execute the access, rather than 1
    which means going to do_page_fault().
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    ---
    171aa2ca
hugetlbpage-hash64.c 4.02 KB