Re: Modularizing IOMMUs (devel/iommu-0.4)

From: Jan Beulich
Date: Fri Oct 22 2010 - 04:00:02 EST


>>> On 20.10.10 at 22:20, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> wrote:
> Another way, less elegant was to manually enforce each function to be stuck
> in the .iommu_text section. For that I made a macro: __iommu that would
> force the function to be stuck in section specific for the IOMMU. So all
> functions in pci-gart_64.c would be funneled in .iommu.gart.text. For
> calgary:
> .iommu.calgary.text., and so on. This is accomplished by having at the
> beginning
> of the the file the name of the IOMMU section, as so:
>
> #define IOMMU_MODULE "gart"
>
> And all of the functions would get stuck in .iommu.gart.text.

For this particular approach - did you consider using objcopy's
--rename-section option?

> And then Question #3): Is there a better way?

Generally I like hpa's suggestion of using pre-loaded but unloadable
modules much better, not the least because in the past I had seen
potential uses for such a mechanism in other places of the kernel.

Jan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/