From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3871ECAC59A for ; Wed, 10 Sep 2025 05:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nCgLh808zcItteVMXL9jaLEwx6dqzX8VyNuK8FSQYGc=; b=VynCgWCLF0coehYEKp9doIDDZo JG2VJLBkPlG1fZ3ETBLILSWh3CZLcSDN3cx8QmXnfu2QDM7PMx44CGC6nv7gSxJ94SO4DW/dCgAJJ s4uxuhk0BsPn2qmfYXn56wHCwHF0Xhh3s7ZAy7tXkhBw7t9sObDfOvhnHynXWfzeDgDXnV/f1pP1k 52Yirizbc6i7mG+HagW/qMqqtSGsf7PkreDgW4jT8ckF1Nh59Np5pOk1MbbZQbirnwpIpblh7Giw6 DfIGvIjqrtnKWsxqbU+EO4jPu6gGmET8padea29EUzrozKDyEGJ7qFtG+lfBr2Y4Sk8fdJLZIbYXP 0GliFjKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uwDN0-0000000C9Od-2Vd1; Wed, 10 Sep 2025 05:27:50 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uwDLc-0000000C8x8-0Pjx for linux-nvme@lists.infradead.org; Wed, 10 Sep 2025 05:26:25 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id AFB3041752; Wed, 10 Sep 2025 05:26:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF34CC4CEF0; Wed, 10 Sep 2025 05:26:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757481983; bh=bqpgnX0YeaX4gP4gTelyGSzbrLPxwuSSl4ugIJkeFPI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=W3++ctIiiR7UFpzqM9AUidv9AQ1n3Dz1tKeZadPk/293ETffI9nRLBp7aQx9AFled M5GCYM1B4a3jkkhLPVRESnUtwcqokI2ZK9ojJ1YPCMkJpjHT45Cl+QruyYKY3aGARs FpovID2F5xbpoec1xDhgC6MFSHIrXsB7JTzFkx6nfm41N+Pm3w/y/LnuGSrU2VRkhJ x7tt8kh1ACIrOtgalXRNyxNgQvord1Z8/t1JGvHRdIaRHxawPvJnDmdHHJxvC9RDqD RQiYwqXBRXcawbcju2eKP99VtdepUl8ofw/258NbTAl3BVZxhNFXZSkWH5N4CtNQIn DIZ8LyFL6amIQ== Date: Wed, 10 Sep 2025 08:26:18 +0300 From: Leon Romanovsky To: Marek Szyprowski Cc: Jason Gunthorpe , Abdiel Janulgue , Alexander Potapenko , Alex Gaynor , Andrew Morton , Christoph Hellwig , Danilo Krummrich , David Hildenbrand , iommu@lists.linux.dev, Jason Wang , Jens Axboe , Joerg Roedel , Jonathan Corbet , Juergen Gross , kasan-dev@googlegroups.com, Keith Busch , linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nvme@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-trace-kernel@vger.kernel.org, Madhavan Srinivasan , Masami Hiramatsu , Michael Ellerman , "Michael S. Tsirkin" , Miguel Ojeda , Robin Murphy , rust-for-linux@vger.kernel.org, Sagi Grimberg , Stefano Stabellini , Steven Rostedt , virtualization@lists.linux.dev, Will Deacon , xen-devel@lists.xenproject.org Subject: Re: [PATCH v6 03/16] dma-debug: refactor to use physical addresses for page mapping Message-ID: <20250910052618.GH341237@unreal> References: <56d1a6769b68dfcbf8b26a75a7329aeb8e3c3b6a.1757423202.git.leonro@nvidia.com> <20250909193748.GG341237@unreal> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250909193748.GG341237@unreal> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250909_222624_176927_3F72B370 X-CRM114-Status: GOOD ( 16.59 ) X-Mailman-Approved-At: Tue, 09 Sep 2025 22:27:43 -0700 X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On Tue, Sep 09, 2025 at 10:37:48PM +0300, Leon Romanovsky wrote: > On Tue, Sep 09, 2025 at 04:27:31PM +0300, Leon Romanovsky wrote: > > From: Leon Romanovsky > > <...> > > > include/linux/page-flags.h | 1 + > > <...> > > > --- a/include/linux/page-flags.h > > +++ b/include/linux/page-flags.h > > @@ -614,6 +614,7 @@ FOLIO_FLAG(dropbehind, FOLIO_HEAD_PAGE) > > * available at this point. > > */ > > #define PageHighMem(__p) is_highmem_idx(page_zonenum(__p)) > > +#define PhysHighMem(__p) (PageHighMem(phys_to_page(__p))) > > This was a not so great idea to add PhysHighMem() because of "else" > below which unfolds to maze of macros and automatically generated > functions with "static inline int Page##uname ..." signature. > > > #define folio_test_highmem(__f) is_highmem_idx(folio_zonenum(__f)) > > #else > > PAGEFLAG_FALSE(HighMem, highmem) After sleeping over it, the following hunk will help: diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index dfbc4ba86bba2..2a1f346178024 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -614,11 +614,11 @@ FOLIO_FLAG(dropbehind, FOLIO_HEAD_PAGE) * available at this point. */ #define PageHighMem(__p) is_highmem_idx(page_zonenum(__p)) -#define PhysHighMem(__p) (PageHighMem(phys_to_page(__p))) #define folio_test_highmem(__f) is_highmem_idx(folio_zonenum(__f)) #else PAGEFLAG_FALSE(HighMem, highmem) #endif +#define PhysHighMem(__p) (PageHighMem(phys_to_page(__p))) /* Does kmap_local_folio() only allow access to one page of the folio? */ #ifdef CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP > > Thanks >