From: Sasha Levin Date: Mon, 16 Oct 2023 02:50:08 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v5.15.136~24^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cac26cee216abae27d556b9244b7d001a7f27ad1;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/powerpc-64e-fix-wrong-test-in-__ptep_test_and_clear_.patch b/queue-4.19/powerpc-64e-fix-wrong-test-in-__ptep_test_and_clear_.patch new file mode 100644 index 00000000000..e6c66f90caa --- /dev/null +++ b/queue-4.19/powerpc-64e-fix-wrong-test-in-__ptep_test_and_clear_.patch @@ -0,0 +1,52 @@ +From 4b2b27cdb7b1b8ef74a692c9ffbc0c8308c862d3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 25 Sep 2023 20:31:16 +0200 +Subject: powerpc/64e: Fix wrong test in __ptep_test_and_clear_young() + +From: Christophe Leroy + +[ 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 +Signed-off-by: Michael Ellerman +Link: https://msgid.link/8bb7f06494e21adada724ede47a4c3d97e879d40.1695659959.git.christophe.leroy@csgroup.eu +Signed-off-by: Sasha Levin +--- + arch/powerpc/include/asm/nohash/64/pgtable.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/powerpc/include/asm/nohash/64/pgtable.h b/arch/powerpc/include/asm/nohash/64/pgtable.h +index 7cd6809f4d332..30fcffc02caad 100644 +--- a/arch/powerpc/include/asm/nohash/64/pgtable.h ++++ b/arch/powerpc/include/asm/nohash/64/pgtable.h +@@ -215,7 +215,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; +-- +2.40.1 + diff --git a/queue-4.19/series b/queue-4.19/series index 24616eacfe5..c77ed10cf84 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -36,3 +36,4 @@ cgroup-remove-duplicates-in-cgroup-v1-tasks-file.patch pinctrl-avoid-unsafe-code-pattern-in-find_pinctrl.patch usb-gadget-udc-xilinx-replace-memcpy-with-memcpy_toio.patch usb-gadget-ncm-handle-decoding-of-multiple-ntb-s-in-unwrap-call.patch +powerpc-64e-fix-wrong-test-in-__ptep_test_and_clear_.patch