[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231128144331.GA1191405@ziepe.ca>
Date: Tue, 28 Nov 2023 10:43:31 -0400
From: Jason Gunthorpe <jgg@...pe.ca>
To: Robin Murphy <robin.murphy@....com>
Cc: joro@...tes.org, kevin.tian@...el.com, will@...nel.org,
iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] iommufd/selftest: Use a fwnode to distinguish devices
On Tue, Nov 28, 2023 at 10:42:11AM +0000, Robin Murphy wrote:
> With bus ops gone, the trick of registering against a specific bus no
> longer really works, and we start getting given devices from other buses
> to probe,
Make sense
> which leads to spurious groups for devices with no IOMMU on
> arm64,
I'm not sure I'm fully understanding what this means?
I guess that the mock driver is matching random things once it starts
being called all the time because this is missing:
static struct iommu_device *mock_probe_device(struct device *dev)
{
+ if (dev->bus != &iommufd_mock_bus_type)
+ return -ENODEV;
return &mock_iommu_device;
}
Is that sufficient to solve the problem?
> but may inadvertently steal devices from the real IOMMU on Intel,
> AMD or S390.
AMD/Intel/S390 drivers already reject bus's they don't understand.
Intel's device_to_iommu() will fail because
for_each_active_dev_scope() will never match the mock device.
amd fails because check_device() -> get_device_sbdf_id() fails due to
no PCI and not get_acpihid_device_id().
s390 fails because !dev_is_pci(dev).
The fwspec drivers should all fail if they don't have a fwspec, and
they shouldn't for mock bus devices since it doesn't implement
dma_configure.
Jason
Powered by blists - more mailing lists