linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Nicolin Chen <nicolinc@nvidia.com>
Cc: joro@8bytes.org, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	rafael@kernel.org, Danilo Krummrich <dakr@kernel.org>,
	Johan Hovold <johan@kernel.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Pranjal Shrivastava <praan@google.com>,
	Mostafa Saleh <smostafa@google.com>,
	linux-kernel@vger.kernel.org, iommu@lists.linux.dev,
	driver-core@lists.linux.dev, Sonang Patel <sonangp@nvidia.com>,
	Ankit Agrawal <ankita@nvidia.com>,
	shameerali.kolothum.thodi@huawei.com
Subject: Re: [PATCH v3 6/7] iommu: Park TDISP T=0 devices in the blocking domain
Date: Thu, 26 Nov 2026 11:01:43 -0400	[thread overview]
Message-ID: <20261126150143.GI114472@nvidia.com> (raw)
In-Reply-To: <awfP/IZxaVA7ET0o@nvidia.com>

On Wed, Nov 25, 2026 at 10:21:48PM -0800, Nicolin Chen wrote:
> On Wed, Nov 25, 2026 at 02:07:45PM -0400, Jason Gunthorpe wrote:
> > > [ ... 28 lines skipped ... ]
> > > @@ -1238,6 +1238,14 @@ static int iommu_create_device_direct_mappings(struct iommu_domain *domain,
> > >  	unsigned long pg_size;
> > >  	int ret = 0;
> > >  
> > > +	/*
> > > +	 * The direct-map reserved regions are still fine because the T=0 stream
> > > +	 * always goes to an identity mapping. Skip them: recording the request
> > > +	 * would only refuse the device its blocking domain.
> > > +	 */
> > > +	if (iommu_using_t0_stream(dev))
> > > +		return 0;
> > > +
> > 
> > Not sure about this. If we are allocating a paging domain then it
> > should always have the direct mappings setup in it.
> 
> Hmm, is there a paging domain for t0? I thought it's always on the
> blocked domain..
> 
> Even if there is one, t0 would ignore those mappings, since it goes
> through the underlying hypervisor path, right?

Right, but this function is part of allocating a paging domain, the
above argument is we don't use the paging domain in t0. So if we are
going to allocate one it is for t1 and that means it should have this
stuff in it. So why have this test here?

> > I think this patch is the right idea, but it should probably be
> > removed from this series for now if we don't need it to make a basic
> > trusted vIOMMU work.
> 
> Without it, every device sets dev->iommu->require_direct for RMR:
> 
> 		if (entry->type == IOMMU_RESV_DIRECT)
> 			dev->iommu->require_direct = 1;
> 
> Then, __iommu_device_set_domain() would fail the first test:
> 
> 	if (dev->iommu->require_direct &&
> 	    (new_domain->type == IOMMU_DOMAIN_BLOCKED ||
> 	     new_domain == group->blocking_domain)) {
> 		dev_warn(dev,
> 			 "Firmware has requested this device have a 1:1 IOMMU mapping, rejecting configuring the device without a 1:1 mapping. Contact your platform vendor.\n");
> 		return -EINVAL;
> 	}

This should be covered with another test if the viommu is bypassed,
not by messing with require_direct..

Jason

  reply	other threads:[~2026-11-26 15:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 20:50 [PATCH v3 0/7] iommu/arm-smmu-v3: Support guest-level Realm VSMMU (Part-1) Nicolin Chen
2026-11-10 20:50 ` [PATCH v3 1/7] firmware: arm_rmm: Add VSMMU commands and fields Nicolin Chen
2026-11-25 18:07   ` Jason Gunthorpe
2026-11-10 20:50 ` [PATCH v3 2/7] dma-mapping: Let a device declare that it reaches private memory Nicolin Chen
2026-11-25 18:07   ` Jason Gunthorpe
2026-11-10 20:50 ` [PATCH v3 3/7] dma-mapping: Keep DMA memory private for capable devices Nicolin Chen
2026-11-25 18:07   ` Jason Gunthorpe
2026-11-25 22:54   ` Marek Szyprowski
2026-11-10 20:50 ` [PATCH v3 4/7] iommu: Let a driver mark an IOMMU as confidential Nicolin Chen
2026-11-25 18:07   ` Jason Gunthorpe
2026-11-25 22:38     ` Nicolin Chen
2026-11-10 20:50 ` [PATCH v3 5/7] iommu: Introduce TDISP T=0 state for confidential IOMMUs Nicolin Chen
2026-11-25 18:07   ` Jason Gunthorpe
2026-11-26  4:49     ` Nicolin Chen
2026-11-26 14:57       ` Jason Gunthorpe
2026-11-26  6:28     ` Nicolin Chen
2026-11-26 14:59       ` Jason Gunthorpe
2026-11-10 20:50 ` [PATCH v3 6/7] iommu: Park TDISP T=0 devices in the blocking domain Nicolin Chen
2026-11-25 18:07   ` Jason Gunthorpe
2026-11-26  6:21     ` Nicolin Chen
2026-11-26 15:01       ` Jason Gunthorpe [this message]
2026-11-10 20:50 ` [PATCH v3 7/7] iommu/arm-smmu-v3: Probe a guest-level Realm VSMMU via RSI commands Nicolin Chen
2026-11-25 18:07   ` Jason Gunthorpe
2026-11-26  5:08     ` Nicolin Chen

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=20261126150143.GI114472@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=ankita@nvidia.com \
    --cc=catalin.marinas@arm.com \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=iommu@lists.linux.dev \
    --cc=johan@kernel.org \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mark.rutland@arm.com \
    --cc=nicolinc@nvidia.com \
    --cc=praan@google.com \
    --cc=rafael@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=smostafa@google.com \
    --cc=sonangp@nvidia.com \
    --cc=will@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;
as well as URLs for NNTP newsgroup(s).