Re: [PATCH 2/2] iommufd/selftest: Use normal IOMMU registration

From: Robin Murphy
Date: Tue Nov 28 2023 - 09:53:38 EST


On 28/11/2023 2:35 pm, Jason Gunthorpe wrote:
On Tue, Nov 28, 2023 at 10:42:12AM +0000, Robin Murphy wrote:
The IOMMU core now supports coexistence of fwspec-based drivers, which
the mock driver now is, so let's bring the mock bus into iommu_buses,
drop the special interface, and use the normal registration flow. The
one concession we have to make is to ensure that the mock bus is
registered early enough so that bus_for_each_dev() doesn't error out
for other IOMMU drivers registering before iommufd_test_init() runs.

This makes iommufd non-modular which becomes a total PITA for development :(

Oh fiddle, I misread the makefile, and indeed this doesn't work at all, sorry (turns out it fails to even build for IOMMUFD=m...) Guess I should have been more wary of how suspiciously easy it seemed :(

Dynamic bus registration in general would be a neat thing to explore at some point, since the static iommu_buses array isn't my most favourite part of the whole business, but I guess we leave this as-is for now.

Robin.