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
Unknown Object (File)
Wed, Apr 8, 9:10 PM
Unknown Object (File)
Mon, Apr 6, 8:38 PM
Unknown Object (File)
Sun, Apr 5, 4:29 AM
Unknown Object (File)
Sat, Apr 4, 11:40 PM
Unknown Object (File)
Sat, Apr 4, 8:46 PM
Unknown Object (File)
Sat, Apr 4, 7:51 AM
Unknown Object (File)
Fri, Apr 3, 9:52 PM
Unknown Object (File)
Sun, Mar 29, 1:57 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