On Sat, Jun 07, 2014 at 08:36:47AM +1000, matthew green wrote: > > let's not forget my favourite mis-feature of MSI/MSI-X: > > if you misconfigure the address, interrupts might cause main memory to > be corrupted. i've seen this happen, and it was rather difficult to > diagnose the real culprit..
Picking up this discussion again, rather late. If there is an IOMMU available, shouldn't it be used to protect against this kind of memory corruption? Even some x86 machines have IOMMUs these days. > i'm a little confused about bus_msi(9) -- pci_intr(9) is already an MD > interface, so if it was extended or if we copied the pci_intr_map_msi() > functions from elsewhere, it's still MD code we have to write. > what does bus_msi(9) add? who would use it? bus_msi(9) gives MI code access to doorbells: MI code uses it to establish a doorbell -> interrupt handler mapping and find out the doorbell's physical address. All the code to map the doorbell's physaddr into a PCI busaddr, to program the IOMMU if there is one, to establish the MSI address/data in the PCI device, and to enable MSI is MI code using bus_dma(9), pci(9), and bus_space(9). Even if it's 100 lines or fewer, why duplicate it across platforms? Also, doorbells look to me like a potentially useful facility to make generally available, even apart from their use with PCI MSI. Anyway, I'm curious what uses people would come up with. Dave -- David Young dyo...@pobox.com Urbana, IL (217) 721-9981