Page MenuHomeFreeBSD

pci_user.c: Call bus_translate_resource before mmaping bars
ClosedPublic

Authored by kd on Apr 6 2021, 2:11 PM.
Tags
None
Referenced Files
F122501377: D29604.id86905.diff
Sat, Jul 5, 7:53 PM
F122433582: D29604.id.diff
Sat, Jul 5, 7:54 AM
Unknown Object (File)
Tue, Jul 1, 2:01 AM
Unknown Object (File)
Sun, Jun 29, 11:40 AM
Unknown Object (File)
Sun, Jun 29, 4:47 AM
Unknown Object (File)
Sat, Jun 28, 10:44 PM
Unknown Object (File)
Sat, Jun 28, 4:27 PM
Unknown Object (File)
Sat, Jun 28, 4:27 PM
Subscribers

Details

Summary

On some armv8 machines there is no 1:1 mapping between cpu and pci bus BAR base addresses.
When a BAR is allocated in kernel using bus_alloc_resource_any this translation is handled in ofw_pci_activate_resource.
Do the same in pci_user.c by calling bus_translate_resource devmethod. This fixes mmaping BARs to userspace on armada7k and possibly many other platforms.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable