mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aneesh Kumar K.V <aneesh.kumar@kernel.org>
To: Tom Lendacky <thomas.lendacky@amd.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	iommu@lists.linux.dev
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>, "H . Peter Anvin" <hpa@zytor.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Mostafa Saleh <smostafa@google.com>,
	Alexander.Deucher@amd.com, Vasant.Hegde@amd.com,
	Timo Witte <timo.witte@gmail.com>,
	Alexey Kardashevskiy <aik@amd.com>
Subject: Re: [PATCH] x86/mm: Don't force unencrypted DMA for IOMMU-backed devices
Date: Tue, 15 Sep 2026 14:20:15 +0530	[thread overview]
Message-ID: <yq5aqziu2914.fsf@kernel.org> (raw)
In-Reply-To: <df4209bb-0bfb-4f19-9de1-2b03148846fc@amd.com>

Tom Lendacky <thomas.lendacky@amd.com> writes:

> On 9/8/26 06:32, Aneesh Kumar K.V (Arm) wrote:

 [ ... 39 lines skipped ... ] 

>>  
>> @@ -30,7 +31,7 @@ bool force_dma_unencrypted(struct device *dev)
>>  	 * device does not support DMA to addresses that include the
>>  	 * encryption mask.
>>  	 */
>> -	if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT)) {
>> +	if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT) && !use_dma_iommu(dev)) {
>
> When this support was originally added many years ago, this function was
> not called if an IOMMU was active and generating IOVAs. So if this
> function is now called even when an IOMMU is performing the DMA mapping,
> then this is appropriate. Although, it would seem that if an IOMMU is
> performing the mapping and this function is still being called, checking
> use_dma_iommu(dev) and exiting early from force_dma_unencrypted() at the
> very beginning is more appropriate, right?
>

I don't think that is correct for a confidential guest with a stage-1 IOMMU.


> @Alexey, would that impact your TIO/TDISP support at all?
>

-aneesh

      reply	other threads:[~2026-09-15  8:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260908113247eucas1p12e67fcdf50573da0c0fac36cee4b06e9@eucas1p1.samsung.com>
2026-09-08 11:32 ` Aneesh Kumar K.V (Arm)
2026-09-08 14:24   ` Michael Kelley
2026-09-08 14:31     ` Marek Szyprowski
2026-09-11  8:32   ` Marek Szyprowski
2026-09-14 13:17   ` Tom Lendacky
2026-09-15  8:50     ` Aneesh Kumar K.V [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yq5aqziu2914.fsf@kernel.org \
    --to=aneesh.kumar@kernel.org \
    --cc=Alexander.Deucher@amd.com \
    --cc=Vasant.Hegde@amd.com \
    --cc=aik@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=iommu@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=smostafa@google.com \
    --cc=tglx@kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=timo.witte@gmail.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®