From nobody Sun Feb 8 06:54:07 2026 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 A033BC001DB for ; Thu, 10 Aug 2023 09:35:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233231AbjHJJfy (ORCPT ); Thu, 10 Aug 2023 05:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232921AbjHJJfw (ORCPT ); Thu, 10 Aug 2023 05:35:52 -0400 Received: from out-75.mta0.migadu.com (out-75.mta0.migadu.com [91.218.175.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9958B2703 for ; Thu, 10 Aug 2023 02:35:43 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1691660140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=05GIU748ktQIL7cSAWgzz+r92+3CwTfIekEnt8UTyg8=; b=nTPIGjrO7o2dlBI9Oi2x0e3Wqbdyw2L1BvdKyU5Hl1a2Q9qEI7DlCtXnje7AaeGn60TPnl A87RvHyFkV8gNSXi5SXBDLymv8zu8BiHLk9OJUAwd/5ilbENReedkSQArBNVcrVES2CIz3 X8k00XiztStqdQ7Cl/uhor90kw/lkts= From: Qi Zheng To: catalin.marinas@arm.com, will@kernel.org, akpm@linux-foundation.org, wangkefeng.wang@huawei.co, pasha.tatashin@soleen.com, muchun.song@linux.dev Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Qi Zheng Subject: [PATCH] arm64: mm: use ptep_clear() instead of pte_clear() in clear_flush() Date: Thu, 10 Aug 2023 09:32:41 +0000 Message-Id: <20230810093241.1181142-1-qi.zheng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Qi Zheng In clear_flush(), the original pte may be a present entry, so we should use ptep_clear() to let page_table_check track the pte clearing operation, otherwise it may cause false positive in subsequent set_pte_at(). Fixes: 42b2547137f5 ("arm64/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK") Signed-off-by: Qi Zheng --- arch/arm64/mm/hugetlbpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index 21716c940682..9c52718ea750 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -236,7 +236,7 @@ static void clear_flush(struct mm_struct *mm, unsigned long i, saddr =3D addr; =20 for (i =3D 0; i < ncontig; i++, addr +=3D pgsize, ptep++) - pte_clear(mm, addr, ptep); + ptep_clear(mm, addr, ptep); =20 flush_tlb_range(&vma, saddr, addr); } --=20 2.30.2