Re: [PATCH v3 6/7] iommu: Park TDISP T=0 devices in the blocking domain
From: Nicolin Chen
Date: Thu Nov 26 2026 - 14:51:08 EST
On Thu, Nov 26, 2026 at 11:01:43AM -0400, Jason Gunthorpe wrote:
> 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:
> > > 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..
OK. I thought skipping require_direct could be cleaner since we
would not need to deal with every require_direct call site that
can be easy to miss.
I'll add an iommu_cc_viommu_bypassed test here, and another one
to the release domain path too.
Thanks
Nicolin