On Tue, Nov 11, 2014 at 11:31:38AM +0000, Hou Pengyang wrote: > From: Steven Capper <steve.capper@xxxxxxxxxx> > > commit f2950706871c4b6e8c0f0d7c3f62d35930b8de63 upstream. > > Long descriptors on ARM 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 introduces a new macro pte_isset which performs the bitwise > and, then performs a double logical invert (where needed) to ensure > predictable downcasting. The logical inverse pte_isclear is also > introduced. > > Equivalent pmd functions for Transparent HugePages have also been > added. > > Signed-off-by: Steve Capper <steve.capper@xxxxxxxxxx> > Reviewed-by: Will Deacon <will.deacon@xxxxxxx> > Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx> > [hpy: Backported to 3.10: > - adjust the context > - ignore change to pmd, because 3.10 does not support HugePage.] > Signed-off-by: Hou Pengyang <houpengyang@xxxxxxxxxx> > > Conflicts: > arch/arm/include/asm/pgtable-3level.h > arch/arm/include/asm/pgtable.h > --- > arch/arm/include/asm/pgtable.h | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) Can you provide a backport of this patch to 3.14-stable as well? thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html