From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41F513A8735 for ; Tue, 21 Apr 2026 12:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776775226; cv=none; b=VAwFLQwr4Xe+xP58DmfApwLvda+vbvaFNLleeHLOXN1u7WqXzPDjvGKT8YWWuvaiyMLFDWXCB5E6PegwmqWha2du8OsCon2uE6dCUWUutLmAi8mCktP5B98n4zG5xQSRdo7R8Qfx0MPjHR/KatsrxV5Prcbj1taiYcm9YofOG8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776775226; c=relaxed/simple; bh=/xrn13xd1Z3Y/ZATsukwSHVMmxT69m/3ihQ3H3rLbXI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=chmpr4gOvnzkcH1KV57IRRNBquVEAfMzkF0jhFwK+2mqAwGWnSCEiGk/ZlrIqaPyEwMMIPabaVRRLdAr/ugcFr5MgDOG7fh3+Q19o9lPff+DJalpv5jhVCcz+GNEcL3mfvznPAMUyUT7zUlwcTCDJ8HMr7jW73T4cQ42rQju3Ug= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=iWc5NpB6; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="iWc5NpB6" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-8d67a483d3eso466849085a.1 for ; Tue, 21 Apr 2026 05:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1776775224; x=1777380024; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TjtlHZkR2YWyZUai4uZdFHleDbuit/h9YJx49rc1+Do=; b=iWc5NpB68hx6Hfhp642+dCsUqoE73AXmfYlddGkeVvg+ddEkk9iN+mZmsPC9v03hCY XlIrbCldH9lc8zQQCfPjEyS/ifX1T+UvZOC64g20+czc8dpYRtZMqmrUZGIKOsjJm7Id oFZ2pu2D6UxWnxzZGB7rS3wrzyt6IKCybnKoLdnuV6NWBjswGtNrR/eQRx33gHW0xg2/ DU2+6pplK2p2FU3+wzf5VegwSrzTFvTyWi5s9gwp+uwEMSB7FbXAbLP/iK5EsiTIXXSd OZTskrUXU8E+NVXhPhlrY2MCQ0NDtXwmpiHF+17vl/QaKfS37ot2q7X5Qcz/j+wpv+Ep pDjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776775224; x=1777380024; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TjtlHZkR2YWyZUai4uZdFHleDbuit/h9YJx49rc1+Do=; b=TGdgmeXNQ1CRnBttIuKz5jkk6muRvY/H1Sp60cGi6NAUStM7iT7MA0pbEXsBnLZsjW XJ0ItTjmekYIel4dJ2iMvG2GfPYlTkrA2w81CHpvF5kKNZNKRfksaQYE1bX8fJKhmuVd /PfduEXKCoPhS3J7IN+l7BtNBmP2QBGEiHVxZM5y8OpR3laT4Pcg5zx/Osa/QRhDF3jH xrSoLpsbuz9VBi4MImvjHT82CRt8P7qBIOwm12Y7Ux4MRuVsh8TZhv+oCnVLLSkmnCcF 4Txd9lwCgsbPGrT3I/k4V/JqeCG3ILUWHNmRsZ7JrvXq+QMtREBlnPgl7XcXcG5fMLuD RjyA== X-Forwarded-Encrypted: i=1; AFNElJ9GcNNnvDGW6wgqJOvz5LTn0C//LOfRGnpYeB079b+eSrAyYUZGYpMldJvksfAPNvifKKCJtoImcoECAW0=@vger.kernel.org X-Gm-Message-State: AOJu0YwKoSBCYt92XVE0afvbXKe9+3+il/3t2F+WVVIlzoB62myb+zKW 2bJZP4gV4+7wiHf6iG05KRe7W218s6XUtfG+jRNsYZDJAgXc0P6Nr0c6DIOBXCKE+Rg= X-Gm-Gg: AeBDiesaQ91td9wBzRp9L/LiWJTKGRxl/vFfKJ9cET6Scl4E6V4BEfyGR0mGxn+kuZr hFvI4iUfgYU7/ZYqymobWq8z+qQ6k6dwd3gpRHnCJBdJs9OVxWxhmiJdospBdWC7L6sPFThgJQa kSH/2MHXE7vOlYF4Brp8QwXPbsqvyZez3gOByaMx7Gz5yM5ODa2Fon6H9c8x4hZ+YCE4EJj7V3c bPaPYOaPVOUV7HhFwK5DqJ+qIYm+LH/vG5RNOww1+PvrPT7C9ccjGKeD5b/JgBjNU4L1zECggiU /VHRnjdirZQ3zjH+HTGIGHInNRjmBAkUTQeQA2ZFMfua68fFrgjLh70y0rhHtrsF83WQnv5LH9E UWwptAeDUrSOiQcYIGO3tsBqFkzF4ivyJwEI+pBkqE6yz8iFfyeuE5ioSYNI25Bm6rl1JFYhneD R+ojP8+bxBYC+Td4a26zW+kKxgsnenXBcyTzZ70rJ8ex1s7myTsv/PzvE0S1dR0VooKDhUzKlqa P3yJRl+1GUUghqi X-Received: by 2002:a05:620a:40d3:b0:8ee:c753:8f59 with SMTP id af79cd13be357-8eec753a7fbmr180250185a.59.1776775224121; Tue, 21 Apr 2026 05:40:24 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8e7d5fe9638sm1065292785a.1.2026.04.21.05.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2026 05:40:23 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wFAOs-00000001OHU-3awX; Tue, 21 Apr 2026 09:40:22 -0300 Date: Tue, 21 Apr 2026 09:40:22 -0300 From: Jason Gunthorpe To: "Aneesh Kumar K.V (Arm)" Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, robin.murphy@arm.com, m.szyprowski@samsung.com, will@kernel.org, maz@kernel.org, suzuki.poulose@arm.com, catalin.marinas@arm.com, jiri@resnulli.us, Mostafa Saleh Subject: Re: [PATCH v2 0/8] dma-mapping: Use DMA_ATTR_CC_SHARED through direct, pool and swiotlb paths Message-ID: <20260421124022.GD3611611@ziepe.ca> References: <20260420061415.3650870-1-aneesh.kumar@kernel.org> 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: <20260420061415.3650870-1-aneesh.kumar@kernel.org> On Mon, Apr 20, 2026 at 11:44:07AM +0530, Aneesh Kumar K.V (Arm) wrote: > This series propagates DMA_ATTR_CC_SHARED through the dma-direct, > dma-pool, and swiotlb paths so that encrypted and decrypted DMA buffers > are handled consistently. > > Today, the direct DMA path mostly relies on force_dma_unencrypted() for > shared/decrypted buffer handling. This series consolidates the > force_dma_unencrypted() checks in the top-level functions and ensures > that the remaining DMA interfaces use DMA attributes to make the correct > decisions. > > The series: > - moves swiotlb-backed allocations out of __dma_direct_alloc_pages(), > - propagates DMA_ATTR_CC_SHARED through the dma-direct alloc/free > paths, > - teaches the atomic DMA pools to track encrypted versus decrypted > state, > - tracks swiotlb pool encryption state and enforces strict pool > selection, > - centralizes encrypted/decrypted pgprot handling in dma_pgprot() using > DMA attributes, > - makes dma_direct_map_phys() choose the DMA address encoding from > attrs, and > - uses the selected swiotlb pool state to derive the returned DMA > address. I think this is very reasonable looking. Jason