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 2C3AACAC582 for ; Fri, 12 Sep 2025 15:35:07 +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:References:Content-Type: Content-Transfer-Encoding:In-Reply-To:From:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9atdt/om7OmffbDgov9WTxIsiO59X0BmEMtINP1uP9A=; b=Q0kR32xvEj+cvz4fJv+85pvJOX pGI/GaD1olX9tI0El0H28U0a6ZtdCz4fqY5iJBACszrOQ1iHM3qtDBoLq82jB9nFR1A1XDBt3ZY7M D7TA0rdWIhN1VTDgCiZwstyR53FcMrL4i2oWgBxExiJfD3c5sPbZXVCmAUtwiFcfemFR2U3gXza0h HTxkMEqYvYv/AMK7uYBq+a/xkldO6buvxajtBTvwyDYvCGaoQh20wDt13fI30BuRsBe6Lwwzxa206 wnycoOL6Ji60N2b2tCXEzi0N26KFs2waNngUrt32KG4U2tMze1ys3DxccWydFp+QqqEzVmiIxXDLu 6Ctv57pQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1ux5nb-0000000AHhU-2nBv; Fri, 12 Sep 2025 15:34:55 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uwphP-00000005gBf-3eF3 for linux-nvme@lists.infradead.org; Thu, 11 Sep 2025 22:23:29 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20250911222322euoutp011634560d57af0d6769ea82508ee6c7b3~kWqER7Qs81513015130euoutp01K; Thu, 11 Sep 2025 22:23:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20250911222322euoutp011634560d57af0d6769ea82508ee6c7b3~kWqER7Qs81513015130euoutp01K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1757629402; bh=9atdt/om7OmffbDgov9WTxIsiO59X0BmEMtINP1uP9A=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=oYf4Wl/vK4mtCwLnlaPuk0Vbqm1kIIG4/GofumuhdavmIiBHyUZQRceOU6BgMduk5 UPpbMvZbaMJvAX41rCofkjz8fUum8Xd7cFaLczcWfrjE46zM7Gw77+bY+gxYbnaXwW jL8zkycMTQXVpPJyDpmR0+MuvHwC/4FUakNYU3YU= Received: from eusmtip2.samsung.com (unknown [203.254.199.222]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20250911222321eucas1p114043a72e011e2fff92df33a2133b21e~kWqDhtt8p0600006000eucas1p18; Thu, 11 Sep 2025 22:23:21 +0000 (GMT) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20250911222317eusmtip2aabd06b78078a7146730dff557f2cb71~kWqAG3AB-1019110191eusmtip2F; Thu, 11 Sep 2025 22:23:17 +0000 (GMT) Message-ID: <5ffc63e9-19bd-4e12-92fc-57fe12d10f4f@samsung.com> Date: Fri, 12 Sep 2025 00:23:17 +0200 MIME-Version: 1.0 User-Agent: Betterbird (Windows) Subject: Re: [PATCH v6 03/16] dma-debug: refactor to use physical addresses for page mapping To: Leon Romanovsky 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 Content-Language: en-US From: Marek Szyprowski In-Reply-To: <20250910052618.GH341237@unreal> Content-Transfer-Encoding: 7bit X-CMS-MailID: 20250911222321eucas1p114043a72e011e2fff92df33a2133b21e X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20250910052628eucas1p160daa0dadb6f81d7831d8047628aa9d4 X-EPHeader: CA X-CMS-RootMailID: 20250910052628eucas1p160daa0dadb6f81d7831d8047628aa9d4 References: <56d1a6769b68dfcbf8b26a75a7329aeb8e3c3b6a.1757423202.git.leonro@nvidia.com> <20250909193748.GG341237@unreal> <20250910052618.GH341237@unreal> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250911_152328_500364_2779862A X-CRM114-Status: GOOD ( 16.82 ) X-Mailman-Approved-At: Fri, 12 Sep 2025 08:34:53 -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 10.09.2025 07:26, Leon Romanovsky wrote: > 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 Okay, I will add this fixup while applying the patches. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland