Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc/64e: Fix wrong test in __ptep_test_and_clear_young()

Commit 45201c879469 ("powerpc/nohash: Remove hash related code from
nohash headers.") replaced:

if ((pte_val(*ptep) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0)
return 0;

By:

if (pte_young(*ptep))
return 0;

But it should be:

if (!pte_young(*ptep))
return 0;

Fix it.

Fixes: 45201c879469 ("powerpc/nohash: Remove hash related code from nohash headers.")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/8bb7f06494e21adada724ede47a4c3d97e879d40.1695659959.git.christophe.leroy@csgroup.eu

authored by

Christophe Leroy and committed by
Michael Ellerman
5ea0bbaa 5d9cea8a

+1 -1
+1 -1
arch/powerpc/include/asm/nohash/64/pgtable.h
··· 197 197 { 198 198 unsigned long old; 199 199 200 - if (pte_young(*ptep)) 200 + if (!pte_young(*ptep)) 201 201 return 0; 202 202 old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0, 0); 203 203 return (old & _PAGE_ACCESSED) != 0;