]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: Ensure pmd_present() returns false after pmd_mknotpresent()
authorCatalin Marinas <catalin.marinas@arm.com>
Thu, 5 May 2016 09:44:02 +0000 (10:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Jun 2016 19:16:56 +0000 (12:16 -0700)
commit97fc1b996f9ad1a77bc6bb2127f5002c66e66c5f
treeb32ef7fad9022114ccdb54c4e3878546a7dec782
parent930f1194d44f585fb0aa1f6f41faae3fb0a1f82f
arm64: Ensure pmd_present() returns false after pmd_mknotpresent()

commit 5bb1cc0ff9a6b68871970737e6c4c16919928d8b upstream.

Currently, pmd_present() only checks for a non-zero value, returning
true even after pmd_mknotpresent() (which only clears the type bits).
This patch converts pmd_present() to using pte_present(), similar to the
other pmd_*() checks. As a side effect, it will return true for
PROT_NONE mappings, though they are not yet used by the kernel with
transparent huge pages.

For consistency, also change pmd_mknotpresent() to only clear the
PMD_SECT_VALID bit, even though the PMD_TABLE_BIT is already 0 for block
mappings (no functional change). The unused PMD_SECT_PROT_NONE
definition is removed as transparent huge pages use the pte page prot
values.

Fixes: 9c7e535fcc17 ("arm64: mm: Route pmd thp functions through pte equivalents")
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/pgtable-hwdef.h
arch/arm64/include/asm/pgtable.h