Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp478825rdb; Thu, 22 Feb 2024 09:21:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWjOliwsV8mPF2eQAAg4j7dbdBV8jyCyH89ectEH5Bpfl6CY966U50jR9C552aR3jUmhrw3oT+Vfux9WZB3DCm2H8wTZlwN9sf5ecb5sg== X-Google-Smtp-Source: AGHT+IG9MM/3JAnNCOaU8tgbo7wfS6Wy99GiA37ZXTUiXydF4CgAI7tfvdYszdULUF8PfEcKLTan X-Received: by 2002:a05:6e02:13c2:b0:365:13c0:1bc3 with SMTP id v2-20020a056e0213c200b0036513c01bc3mr18399953ilj.20.1708622504621; Thu, 22 Feb 2024 09:21:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708622504; cv=pass; d=google.com; s=arc-20160816; b=rqso9KxpFJ28OEgWmmhbhAXe0PyuHc8fqcHhr2FeAL+N4x85bOL+G6B15DF0oc+QAS OIaBLPi1vnhXvOD6RkVe0+mELdGRb/vhPpS6Z9D6L9Q0OFmRObzHlvsGTpXdXvl4gKrn +7yg1a1x9kOi9ruz+w2LhB0/TaBs4qw1Ccxm0PUexlOrLMLVfVj53vw4FhrRue7asU2I nAuyqatUi6Z1LtWnL3A9y/v+yKd7l4mJKgZZvU4TXF7J6gZ1K1bVrTQ4HHdZ765lXsvI S8Yd4UaFJgJKmfFSLtmmd5hswu5pClZw/4CQJlg21gJ2u/kc9aPOQvZ7oLxCNQK6CQEX WKWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=AFeYNRFIfcJikzrVy0rC22gQ2tTDpuWFx/vVmZWeO04=; fh=gjnM5B/uqHN4dUWrU/h5aAKjEUVqICoBOkBg3Hilb0Y=; b=t8i+IIBSQe81wn5Ri4l0l23DgomJvLiQW8WRQX1/ZkCs9C8K61AVjdumSNqkeK5jTM PFu3jN7vB67waeXUEtk0EpLytZBkymI5M/dnvJ9v0EHXA/n+klg4GwdLy3AjyrH8FkYI 9FCaUWmqQyUIXc2gigGixAoXIpL+JO/AbeNj33ENaHFMVTyFq2ZayUTCshCrwFpR7lnh BdAt21pfceaPcPyLfAMY/WjtwQwfM0Z27jY76p5NdkJxgTworhPSuiEDo70319ICzVrx oFw7lKA3OVTxJ/JcpG8RcvQg5BcrRw5k5/oOGox12HTgM8WJ2oDlXVtZRFjz1MM+mkAA QHXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="Tnh1/pa0"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-76671-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76671-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m25-20020a638c19000000b005d8c57281dfsi10781657pgd.410.2024.02.22.09.21.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 09:21:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76671-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="Tnh1/pa0"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-76671-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76671-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E600EB294F3 for ; Thu, 22 Feb 2024 14:07:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35F0E14F9FE; Thu, 22 Feb 2024 14:05:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Tnh1/pa0" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6AB3146010 for ; Thu, 22 Feb 2024 14:05:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708610744; cv=none; b=UHsCXQCwraL9OuqqRe2KJegpUxDnM0D9wL0EkS+lVY1g7PO53kh38Z0AJwrBh3e44pZXdFNt5O4AYpGHeeo3/CjQlXDLzb7Y4876d0o5HtuE02M04iNVtHfm6cSD9H54S3tf+PjUVuqwLoeNKfeH2NkR31BvLXyWtK+vdZxuDAA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708610744; c=relaxed/simple; bh=Q/xurY/WqspoySgD42YQGC+030O+/0qfcS9IGxnhL58=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YCo6Ibccz53m5HcPaoWSK8vv/hgWq8Iy3qhbn3EfHYTmYA77VKDPvS/1GVAxRtU6VrECSPfnVyx8vXOvualVAvvhigQSYS2TneRspWI4bXTLF749/jdj6WBlKojgONVhhEgRnRmzPyPI4JXA8gUx8thv+776wu+h0QdcIqxIAMo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Tnh1/pa0; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=AFeYNRFIfcJikzrVy0rC22gQ2tTDpuWFx/vVmZWeO04=; b=Tnh1/pa011xn9yvUG4PrQnNJs0 OuiFUSDIBiEMTfVDbyz6cEZfk0X+mEJNzWjeextngK+i3jdaCaRf/tN8Eg2Rhe7WySwgQLyMtl9xF aOJdi8l8u58GeTQV5UyjfRUEf5uuJfBNJp8zgF1GKiGapruKDqVGmU1tt0z2VGuXoBtSaLyOVaOZa 3XanYICkXONVb0B4eOeeR47Mby4i+f9xpOn9UPTWr0NA+ncQBe2+BbpWTpMYUyY+8leqkEoPk9WA4 WPr6/xdk88sheuffb1iEk91fqD8EcKk7qvE2WebL1jPuQbiedIX0LoE94h+MMJR2jPulqz+mw/Imo JlXtECaw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rd9hc-00000003kn7-12l1; Thu, 22 Feb 2024 14:05:32 +0000 Date: Thu, 22 Feb 2024 14:05:32 +0000 From: Matthew Wilcox To: Yongqiang Liu Cc: linux-arm-kernel@lists.infradead.org, yanaijie@huawei.com, zhangxiaoxu5@huawei.com, wangkefeng.wang@huawei.com, sunnanyong@huawei.com, linux@armlinux.org.uk, rppt@linux.ibm.com, linux-kernel@vger.kernel.org, keescook@chromium.org, arnd@arndb.de, m.szyprowski@samsung.com Subject: Re: [PATCH] arm: flush: check if the folio is reserved for IMO addresses Message-ID: References: <20240222140147.1880357-1-liuyongqiang13@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240222140147.1880357-1-liuyongqiang13@huawei.com> On Thu, Feb 22, 2024 at 10:01:47PM +0800, Yongqiang Liu wrote: > @@ -296,6 +297,9 @@ void __sync_icache_dcache(pte_t pteval) > return; > > folio = page_folio(pfn_to_page(pfn)); > + if (test_bit(PG_reserved, &folio->flags)) > + return; Why are you using PG_foo directly instead of the helpers? if (folio_test_reserved(folio))