• Will Deacon's avatar
    ARM: 8578/1: mm: ensure pmd_present only checks the valid bit · 017864ed
    Will Deacon authored
    [ Upstream commit 62453188 ]
    
    In a subsequent patch, pmd_mknotpresent will clear the valid bit of the
    pmd entry, resulting in a not-present entry from the hardware's
    perspective. Unfortunately, pmd_present simply checks for a non-zero pmd
    value and will therefore continue to return true even after a
    pmd_mknotpresent operation. Since pmd_mknotpresent is only used for
    managing huge entries, this is only an issue for the 3-level case.
    
    This patch fixes the 3-level pmd_present implementation to take into
    account the valid bit. For bisectability, the change is made before the
    fix to pmd_mknotpresent.
    
    [catalin.marinas@arm.com: comment update regarding pmd_mknotpresent patch]
    
    Fixes: 8d962507 ("ARM: mm: Transparent huge page support for LPAE systems.")
    Cc: <stable@vger.kernel.org> # 3.11+
    Cc: Russell King <linux@armlinux.org.uk>
    Cc: Steve Capper <Steve.Capper@arm.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
    017864ed
pgtable-2level.h 7.12 KB