Re: [GIT PULL] AMD IOMMU updates for 2.6.28-rc5

Ingo Molnar
2008-11-19T09:36:46Z

* Joerg Roedel <joro@8bytes.org> wrote:

> We can't test all drivers for those bugs until 2.6.28 will be
> released. And these bugs can corrupt data, for example when a driver
> frees dma addresses allocated by another driver and these addresses
> are then reallocated.
>
> The only way to protect the drivers from each other is to isolate
> them in different protection domains. The AMD IOMMU driver prints a
> WARN_ON() if a driver frees dma addresses not yet mapped. This
> triggered with the bnx2 and the ixgbe driver.
>
> And the data corruption is real, it eat the root-fs of my testbox
> one time.

a WARN_ON() can be acted upon much easier than silent/spurious data
corruption. So printing a WARN_ON() will result in drivers being fixed
a lot faster (and with a lot less debugging needed) than if we were
intentionally letting DMA corruption happen. The WARN_ON() will be
routed to kerneloops.org on the major distros, etc. etc.

> I agree that we need to fix the drivers. I plan to implement some
> debug code which allows driver developers to detect those bugs even
> if they have no IOMMU in the system.

That would be _really_ nice to have.

Ingo