From mboxrd@z Thu Jan 1 00:00:00 1970 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.subspace.kernel.org (Postfix) with ESMTPS id 4C60E20ED; Mon, 16 Mar 2026 19:17:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773688670; cv=none; b=iOQ481HoZ7pjbE2d5tqGuUGr9uonZ9XXxiIrh5rNCzV4hKRht1YdwwsdvZvkvz2L9wgvEGntiL7seaaZEiT/uAGrGuS/mHFDwce89pL73HxgHWBkvG43zbE1eO82ZRzLY6Tt69HgRdJWRtL2QaPKZjXhud5nyUpYS6g1XLYk5/Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773688670; c=relaxed/simple; bh=MKgmyjFuGH4Jj9wA7VW7D52WTrpFreoKGfMl3FvB1fM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nvIDWXklrutuxsRzjZbeW8XatdzlWQSGUD3KXHR4p14ZMbwOWTMzMHx6q6RPsuZpSn+SdCsNxHdLpirvC8VBbPCovVOniIIXbBySjxVML79NFAXBdN9T1+NdSaXS4KIviBRnkVRKE49UsRIF7GPU56YVCi1M0AF13ZwPSv37axk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (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=tWL0Mtpb; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="tWL0Mtpb" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=NdWqcb4hqU1+ie/mbBcn2+9eh+rHjQw3OrJ1LmLY49M=; b=tWL0MtpbizoR7d5lDKODkpzvOf lDvsaM1JuZ2XHLjneWMAMQxGTGV6OvvyRl37MritY0dwie/z3gEG+d0/VOHhp3P2eZiX9G22KPQgO f1DGScXj7+G8ZpQUfcSzD4mVGFcTfQ54QmrIEqwhPaylWk238p8X/TOzShQZgboM0f2NT8W4uT5zt CZx0D3R7pvShJzzyrQPy1Hhevhto92gPDT8VbEcg+l4rkNdgX0KN52NxPO0g3nquiF2ZkuvWDe+XO fa6r3t7fxaHRuUl1jGYhvn4OPZ9NXRZM5WcRXNmEnqvlnxTbX3TRe68i+grkRz24SZj1zUtPLje9h qiPq3Urg==; Received: from [50.53.43.113] (helo=[192.168.254.34]) by bombadil.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1w2DRc-00000004kbI-0Mf5; Mon, 16 Mar 2026 19:17:40 +0000 Message-ID: <659bd750-c67a-4290-8c2d-58bc13c9e2a6@infradead.org> Date: Mon, 16 Mar 2026 12:17:39 -0700 Precedence: bulk X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 4/8] dma-mapping: Introduce DMA require coherency attribute To: Leon Romanovsky , Marek Szyprowski , Robin Murphy , "Michael S. Tsirkin" , Petr Tesarik , Jonathan Corbet , Shuah Khan , Jason Wang , Xuan Zhuo , =?UTF-8?Q?Eugenio_P=C3=A9rez?= , Jason Gunthorpe , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Joerg Roedel , Will Deacon , Andrew Morton Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, virtualization@lists.linux.dev, linux-rdma@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org References: <20260316-dma-debug-overlap-v3-0-1dde90a7f08b@nvidia.com> <20260316-dma-debug-overlap-v3-4-1dde90a7f08b@nvidia.com> Content-Language: en-US From: Randy Dunlap In-Reply-To: <20260316-dma-debug-overlap-v3-4-1dde90a7f08b@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/16/26 12:06 PM, Leon Romanovsky wrote: > diff --git a/Documentation/core-api/dma-attributes.rst b/Documentation/core-api/dma-attributes.rst > index 48cfe86cc06d7..441bdc9d08318 100644 > --- a/Documentation/core-api/dma-attributes.rst > +++ b/Documentation/core-api/dma-attributes.rst > @@ -163,3 +163,19 @@ data corruption. > > All mappings that share a cache line must set this attribute to suppress DMA > debug warnings about overlapping mappings. > + > +DMA_ATTR_REQUIRE_COHERENT > +------------------------- > + > +DMA mapping requests with the DMA_ATTR_REQUIRE_COHERENT fail on any > +system where SWIOTLB or cache management is required. This should only > +be used to support uAPI designs that require continuous HW DMA > +coherence with userspace processes, for example RDMA and DRM. At a > +minimum the memory being mapped must be userspace memory from > +pin_user_pages() or similar. > + > +Drivers should consider using dma_mmap_pages() instead of this > +interface when building their uAPIs, when possible. > + > +It must never be used in an in-kernel driver that only works with > +kernal memory. kernel -- ~Randy