From nobody Fri Dec 19 05:03:51 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEB96C001DB for ; Sat, 2 Sep 2023 12:04:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352107AbjIBMFA (ORCPT ); Sat, 2 Sep 2023 08:05:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230424AbjIBMFA (ORCPT ); Sat, 2 Sep 2023 08:05:00 -0400 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2070EE40 for ; Sat, 2 Sep 2023 05:04:54 -0700 (PDT) Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4RdD9J3WZ7z9vPg; Sat, 2 Sep 2023 14:04:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2o1jhLsrF7Vt; Sat, 2 Sep 2023 14:04:52 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4RdD9J2b5Sz9vPf; Sat, 2 Sep 2023 14:04:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4BDFB8B76C; Sat, 2 Sep 2023 14:04:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id WoRFulWQ2RFb; Sat, 2 Sep 2023 14:04:52 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [192.168.235.22]) by messagerie.si.c-s.fr (Postfix) with ESMTP id F0FB88B763; Sat, 2 Sep 2023 14:04:51 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.16.1) with ESMTPS id 3828aUdQ2428775 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 2 Sep 2023 10:36:30 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.17.1/Submit) id 3828aTJx2428773; Sat, 2 Sep 2023 10:36:29 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Michael Ellerman , Nicholas Piggin Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc/64e: Fix wrong test in __ptep_test_and_clear_young() Date: Sat, 2 Sep 2023 10:36:25 +0200 Message-ID: <2daed51109cbd7e7fbd26fab4e77fc6a27dee63e.1693643773.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1693643784; l=1101; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=haMtYnjtQxVqMvpY7oYaDEZ6lXZKfbxyxvv2KRJklvA=; b=SMOZnYSVdFWxyfkaytiI7/rsWvWbYxB8jB+29qOUFgJx/M7ggTQnryPciLxfYvnq7aLVMgDQQ sKr0eLfYZaUCEHbvWyRaS6DBkrtq24gnGVmvyqAdEDjgfqiBvCPRXqR X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Commit 45201c879469 ("powerpc/nohash: Remove hash related code from nohash headers.") replaced: if ((pte_val(*ptep) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) =3D=3D 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 --- 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/in= clude/asm/nohash/64/pgtable.h index 4ff6aa66b29a..6114a17ed234 100644 --- a/arch/powerpc/include/asm/nohash/64/pgtable.h +++ b/arch/powerpc/include/asm/nohash/64/pgtable.h @@ -154,7 +154,7 @@ static inline int __ptep_test_and_clear_young(struct mm= _struct *mm, { unsigned long old; =20 - if (pte_young(*ptep)) + if (!pte_young(*ptep)) return 0; old =3D pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0, 0); return (old & _PAGE_ACCESSED) !=3D 0; --=20 2.41.0