]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: mm: Add double logical invert to pte accessors
authorSteve Capper <steve.capper@linaro.org>
Tue, 25 Feb 2014 11:38:53 +0000 (11:38 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 28 Feb 2014 15:44:19 +0000 (15:44 +0000)
commitc9a00f497331c74de4bf900985d2e780ac0fa99a
tree71d2115b548e03e13d6913244c42eb300d9f5166
parent66474f4401afc5064f058beed51c608eafaed24b
arm64: mm: Add double logical invert to pte accessors

Page table entries on ARM64 are 64 bits, and some pte functions such as
pte_dirty return a bitwise-and of a flag with the pte value. If the
flag to be tested resides in the upper 32 bits of the pte, then we run
into the danger of the result being dropped if downcast.

For example:
gather_stats(page, md, pte_dirty(*pte), 1);
where pte_dirty(*pte) is downcast to an int.

This patch adds a double logical invert to all the pte_ accessors to
ensure predictable downcasting.

Signed-off-by: Steve Capper <steve.capper@linaro.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/pgtable.h