Patch "powerpc/64e: Fix wrong test in __ptep_test_and_clear_young()" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

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

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     powerpc-64e-fix-wrong-test-in-__ptep_test_and_clear_.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 17f4bfff3463964d7c921d2ed5b7a08a25309afa
Author: Christophe Leroy <christophe.leroy@xxxxxxxxxx>
Date:   Mon Sep 25 20:31:16 2023 +0200

    powerpc/64e: Fix wrong test in __ptep_test_and_clear_young()
    
    [ Upstream commit 5ea0bbaa32e8f54e9a57cfee4a3b8769b80be0d2 ]
    
    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@xxxxxxxxxx>
    Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Link: https://msgid.link/8bb7f06494e21adada724ede47a4c3d97e879d40.1695659959.git.christophe.leroy@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/include/asm/nohash/64/pgtable.h b/arch/powerpc/include/asm/nohash/64/pgtable.h
index 879e9a6e5a870..00a003d367523 100644
--- a/arch/powerpc/include/asm/nohash/64/pgtable.h
+++ b/arch/powerpc/include/asm/nohash/64/pgtable.h
@@ -197,7 +197,7 @@ static inline int __ptep_test_and_clear_young(struct mm_struct *mm,
 {
 	unsigned long old;
 
-	if (pte_young(*ptep))
+	if (!pte_young(*ptep))
 		return 0;
 	old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0, 0);
 	return (old & _PAGE_ACCESSED) != 0;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux