CVSROOT: /cvs Module name: src Changes by: patr...@cvs.openbsd.org 2021/03/22 14:30:21
Modified files: sys/arch/arm64/dev: acpipci.c pci_machdep.c pciecam.c sys/arch/arm64/include: pci_machdep.h sys/dev/fdt : dwpcie.c Log message: Load MSI pages through bus_dma(9). Our interrupt controllers for MSIs typically pass the physical address, however retrieved, to our PCIe controller code. This physical address can in practise be directly given to the PCIe, but it is not a given that the CPU and the PCIe controller are able to use the same physical addresses. This is even more obvious with an smmu(4) inbetween, which can change the world view by introducing I/O virtual addresses. Hence for this it is indeed necessary to map those pages, which thanks to integration with bus_dma(9) works easily. For this we remember the PCI devices' DMA tag in the interrupt handle during the MSI map, so that we can use the smmu(4)-hooked DMA tag to load the physical address. While some systems might prefer to implement "trapping" pages for MSIs, to make sure devices cannot trigger other devices' interrupts, we only make sure the whole page is mapped. Having the IOMMU create a mapping for each MSI is a bit wasteful, but for now it's the simplest way to implement it. Discussed with and ok kettenis@