[intel-platform-dev] how to bind my iommu nexus driver

Mark Johnson Mark.Johnson at Sun.COM
Tue Nov 13 07:54:31 PST 2007



Baolu Lu wrote:
> OK, sounds nobody is interested by my questions. :)

Sorry Baolu, I was on vacation on Friday and in
a meeting all day yesterday.


> On Nov 9, 2007 10:17 PM, Baolu Lu <lubaolu at gmail.com> wrote:
>> Hi all,
>>
>> I am here to ask somebody's help on my kernel coding. First, let me
>> try to describe what I am doing.
>>
>> I am developing lntel IOMMU driver for OpenSolaris. Intel IOMMU is a
>> part of Intel VTD (virtual technology
>> for direct IO), which spec can be downloaded from
>> http://www.intel.com/technology/virtualization/.
>>
>> The BIOS exports the IOMMU information through the DMAR ACPI table.
>> So, first I get the IOMMU information
>> through parsing the ACPI table in the pci_enumverate( ). And create
>> the dev_info structure under the
>> root neuxs. Then want to let the kernel to load my IOMMU nexus driver
>> at the boot time.
>>
>> My questions are:
>>
>> 1. What can I do to let the kernel load the IOMMU nexus driver module
>> automatically during the boot time?

The Intel IOMMUs are unlike other IOMMUs we have come
across. In my experience, the IOMMUs have been integrated
into the IO bridge (and IO bridge driver).

Since there are multiple IOMMUs, each covering specific
devices, which is specified by the BIOS, I don't think
we will be able to have a traditional parent/child driver
relationship between the IOMMUs device drivers.

At this point, I believe we should probe for and manually
setup/load the IOMMU "drivers" from the rootnex driver.
But maybe we can fit multiple IOMMU support into the PCI
express nexus driver. I have to think about that some
more.


>> 2. The platform may have more than one IOMMU units. Each has it's own
>> register set and interrupt. But they share
>> the same bus ops. I want to bind only one driver for them. Does this
>> make sense? To do so, should I create
>> a dev_info structure for each IOMMU unit or just a single one?
>>
>> Thanks for your reading and I am very appreciate for your help.

I'm not sure if we should have one driver/module, or one for
each at this point. You won't be using busops since I don't think
the driver will be a parent of the device using it (unless
we try to fit it into the PCI Express nexus).

Lets start at the beginning... We need a probe routine which
will query if the system has an intel IOMMU and then return
any relevant info we need including info we need to setup
the infrastructure for interrupts/registers.

Just putting place holders for the names for now, if we
has a function which returned the number of intel IOMMUs
in the system (0 if not supported), and then an array
for each IOMMU with the info we need to set it up, what
would the intel_iommu_probe_t struct look like? e.g.
what will you get out of the ACPI tables.


int intel_iommu_probe(intel_iommu_probe_t *info);
void intel_iommu_probe_free(intel_iommu_probe_t *info);



MRJ




More information about the intel-platform-dev mailing list