Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp932976rdg; Fri, 11 Aug 2023 04:56:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFV0mzLf9sojbZ3+qkiJa8uzduRCW3tR8wkLOkD4y4mP+l6gBhEU7HjaTPJKDopgonpuFYF X-Received: by 2002:a05:6808:13cd:b0:3a7:41a7:f7fe with SMTP id d13-20020a05680813cd00b003a741a7f7femr2438346oiw.15.1691754998700; Fri, 11 Aug 2023 04:56:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691754998; cv=none; d=google.com; s=arc-20160816; b=U1S3ZDiHUlY8VXH0BtPS2soM8OWAOr9OKiv5ZPMd2TqDYTz+0L3LaHABr61Zp6QT2j b6EwYIvZpBL2gIsscYBHsWv4ktfLidXFA3p2WSlR5H+fyXUGH1VisCN+Cp0es6Ei9aEs GZHOrK4xcBEuSMQSeWSHOzvEvnqYqZz1UzTjxXsLJuzGeU3N9OqvLblBMa6cwaDBvz8T KIJAWLpCE3Gs0kCWkyWADpsYKNPXgYyOYSAEa5ZjrtCI/sErRvhdCe1CnmJHZ7toNlW2 ZuISuNc21QfHUS+YnLaZ7Ync5CaHPb3XwkJKncJm/nflunIDY/Y/gRsGqbnW0II6yqj7 oorg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ynUffyE4rqqt6TZxnbRQP2Rrm37urDCjnHHmakaENaE=; fh=rHosLu+zOdu5cotxsSAqwEL+Biyl9HMd3DBMqW2LTDQ=; b=xQLY4Huw61p4JLVIkIVDezxLBSKt49NRk/IfM6kCmao3niYMixbhh2/iQxTK5EnfgJ BQEQR/TwHasOvfkGqcms+W36iAURM6HxhKvu5fXBFbXPOx8Jw+1JHTtsFE40o274EGSx M+ldWUa1eKQjgxKNLJaJm2AI+JphaHB+kuHwSkwT/7lRs22UMz9t1EJOZ/TVPL7RBLxk yGYbclahnebJbHffBLmUtohgGjIHYmVjPy2e/kw6VnDWFkfIxlLP0s3glP3BMBIdNEU4 q+yk66YbQII/NLpLYrJAVCE0y4ogEIXsNOQRJj0F+oyCwtPJETYu8zkjMyx5mQl9RFWa cXmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SCQN3lGy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a633e05000000b0056467100dccsi3357727pga.162.2023.08.11.04.56.24; Fri, 11 Aug 2023 04:56:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SCQN3lGy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236089AbjHKLDg (ORCPT + 99 others); Fri, 11 Aug 2023 07:03:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235996AbjHKLDS (ORCPT ); Fri, 11 Aug 2023 07:03:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACBCA1736 for ; Fri, 11 Aug 2023 04:03:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3BB8964392 for ; Fri, 11 Aug 2023 11:03:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF0CFC433C8; Fri, 11 Aug 2023 11:03:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691751797; bh=PjX3Kj30CvssUoUzKqXeYgWsx+H2hFXKVoFi6QaOBNY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SCQN3lGyQBoZwxoioLWZpfDejCNEPdCkuNsAASUmFiChXFzmqJILdpvvrPNubwaX4 FxBfL2iYPzGKq4I1zsAtGCdPUd0g2sdGStehBifmE4WRZVA0bZDN/OtNmvWZAurG8v p4rXVhE2NnPjqKLqHqZW7f+vYUjE9Pv12H6LXDATo7cRNWejmAC9UdR5et2+dtqdsu LPHtaXtqj7afNFie1RBS1gaL/02zicmkKqVW20CspQ84mt/Gzi3VOs/7uY5U2zxmu3 ma8MS5oGac+G/joxsXTXIAGEfoXJI59rOZScOpcP3cLxA500jJk7owqkd36AYol7a6 num+iIFe31AaA== Date: Fri, 11 Aug 2023 12:03:12 +0100 From: Will Deacon To: Qi Zheng Cc: catalin.marinas@arm.com, akpm@linux-foundation.org, wangkefeng.wang@huawei.co, pasha.tatashin@soleen.com, muchun.song@linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Qi Zheng Subject: Re: [PATCH] arm64: mm: use ptep_clear() instead of pte_clear() in clear_flush() Message-ID: <20230811110311.GB6993@willie-the-truck> References: <20230810093241.1181142-1-qi.zheng@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230810093241.1181142-1-qi.zheng@linux.dev> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 10, 2023 at 09:32:41AM +0000, Qi Zheng wrote: > 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(). Isn't this true for most users of pte_clear()? There are some in the core code, so could they trigger the false positive as well? Will