From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (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 5412D3E0C49 for ; Mon, 30 Mar 2026 22:30:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774909853; cv=none; b=lopqFAHT/7ANGmyTEWNBSPcNC6X+YGtghK1U+gY6QqSRtS3jShYyy62XFXqJkPCIaw/yYtkpDj57cnXAmEWOW6rLUk54B6laI+C6uhdWwhBiVne8X09QDDz+Z7lci29Rqm/0DFT8vt1hNVNHgl57juizyD0MgR0frk9kxQG9zaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774909853; c=relaxed/simple; bh=1xBMZPNh6gPQSVfte56TfHDQQjUttxQo7E6pWxBUiOQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QJ+ZxETjclZJTkngFTUOZHw5yLOvQ2Cn6217OK74ao5zDEKAdv8m4l1bDhbgjp40k8X1aDYGR9O4gXLtl0TN/EEmsZ6TpnhrhGEea4FJNg/UzrTmWmUyCRJhXboSdwH7Mn40kH+XaewRIXv5j8Ttpahe56rZ++AvAh0EaXl3aic= 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=cwxjoF89; arc=none smtp.client-ip=209.85.160.176 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="cwxjoF89" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-50b29c4e554so62575541cf.0 for ; Mon, 30 Mar 2026 15:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1774909844; x=1775514644; 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=TPgjfuWm74JPHi/nBulPrKzhbkBSUwgKba+pCSQrHm4=; b=cwxjoF89kC3tY+MzQvApDlJv3e3tJ3y/kDo+FssUlvgbsL3Nj0yg5oUnLPDtgBUlav A5gDcR5uDQcRGjZ8ygp2rTLYVn7ZgeMmdHiCc/IshB/k+Ahr9FHrWz+4SNScY2dFzzhy opX5TuB6Lp28P/rhaeV8QtIdl1OpnxLU4D1tCO7irD/iWy3hB1bMPOfXKJw3jGu4sv5U 03S1YIpuUxa8qloltOmWQlK2XQtMY2Mpp3M/B1Du1wWqoYpZUnzJzwGJbJsg3aJV/mk7 EJn4GSdVj6ldcyYKO7e+PXIvX9jlF/xgKPRsL284fqvLBff51dvhgdR6p5YK66huPqZF uokg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774909844; x=1775514644; 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=TPgjfuWm74JPHi/nBulPrKzhbkBSUwgKba+pCSQrHm4=; b=GRKOvYjmoKgr3YoZu8DlH7yjpKt2j6n6m5s7hs2buAYPhuwTY4SCzjeF0BsmQVKlkN IXCD8Ds3B9yiX3ZGmkCaQVx6Z9oawzlL2MrzaTOr6WAbaQr3xKmM4P9juPs6H4rBffD3 iImXnzO32DGynsu7Wwx7mtZhAzoQkI5/WpqMrzreq1gzDEMvsQlTav86WcU5aF70Rm3v vtmje8qkWUpZa00pNExUqrMrJLSkffES2DSKOiwZlOWxmS4n25tI66kpRmqNJvBoPZOX H5lwf52FwIMeVBBR72C5bLgvTkK6ZRPFjJM6CxUMjJT2po3FnrSHQ8W0eQN8HMjjdF5a TWsA== X-Forwarded-Encrypted: i=1; AJvYcCUzMfgZQ+53ItuoqWKtkqa4yTyrchvTD48yPzyKnIpuUF2wFnNR/ryNM27jbA4hvA9u2vudqbI6oHkkDcc=@vger.kernel.org X-Gm-Message-State: AOJu0YyyfqzYsp8CuzS4owSE1iLCR3FuVo+8skXiSzXIX1AySUMhVrV/ rObPeC5Dw9CLufvBvNShZlb9iQ8lMdB68U0AF3UI9HQosRPLnvtHZ49UPrHztE+KEBA= X-Gm-Gg: ATEYQzz1nwy8AXXFe+f0DSyEcCIGx4S3+29+lF0/3VwJLzzg7cTVfkPlOKO3Y4Va7au kLQ/HnHwXo3rjhgcWpskW1KbpIR9NcF8S1Dpc3KDBxKQiDUGHEzRmiIAJVqW4NUc2GqzoDCCGkX GnN13+470ciYSYKAbuf5LMxqzAg+8XsaZEFSka8ZXdKYs4cLiy0H5xvZh/u4TtCnubMU4zXmDtL /UAkNGJMOfU+T8QQ0f+wJTshScnPWQohF1kOOJ8ut5INB+ha3zzUGkZATYBIpORZHnDYScbQiSb OoYNPrqk/lSJIQpe5y9Rr9JX8QgjPUY3U7xuVuTRJJCGVxBi14oEcsflKJiyW/KjZxtt2XoUbnQ SUkUvQZwtNoDQQ7W3a5kjm0hLJU5Ci+GDqpPr00QkzeghQAM/hYehcDNy7UgHIHw0SVkW6VXPpX VD8lEBTHjbJn3jrs9TteyDgaD7YtAXN4DjmHRjP4sPNDc0R5txA+XsoaopzcpKtPOirWeasw== X-Received: by 2002:a05:622a:40c6:b0:509:1ffc:c538 with SMTP id d75a77b69052e-50ba37f5b1bmr196111651cf.19.1774909844000; Mon, 30 Mar 2026 15:30:44 -0700 (PDT) Received: from ziepe.ca (mctnnbsa70w-159-2-73-22.dhcp-dynamic.fibreop.nb.bellaliant.net. [159.2.73.22]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-50bb2e3ed5csm83384511cf.27.2026.03.30.15.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2026 15:30:42 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1w7L86-00000005I9Z-0JYx; Mon, 30 Mar 2026 19:30:42 -0300 Date: Mon, 30 Mar 2026 19:30:42 -0300 From: Jason Gunthorpe To: Mostafa Saleh 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, aneesh.kumar@kernel.org Subject: Re: [RFC PATCH v2 3/5] dma-mapping: Decrypt memory on remap Message-ID: <20260330223042.GH246076@ziepe.ca> References: <20260330145043.1586623-1-smostafa@google.com> <20260330145043.1586623-4-smostafa@google.com> <20260330151900.GC809900@ziepe.ca> 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: On Mon, Mar 30, 2026 at 08:49:31PM +0000, Mostafa Saleh wrote: > > The one place we should see a force_dma_unencrypted() is directly > > before setting the flag. > > I will look more into this, but my main worry would be > phys_to_dma_direct() and it's callers as I am not sure if is possible to > preserve the alloction origin in all contexts. I'd rather have a very small number of places that recover the phys & flag through some convoluted logic than have it sprinkled all over the place in ever layer.. The helpers were not helpful, they were much more confusing. Jason