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
F136732099: D29604.id86910.diff
Wed, Nov 19, 3:12 AM
F136731962: D29604.id86905.diff
Wed, Nov 19, 3:11 AM
Unknown Object (File)
Tue, Nov 18, 2:14 PM
Unknown Object (File)
Wed, Nov 12, 2:40 PM
Unknown Object (File)
Sun, Nov 9, 2:37 AM
Unknown Object (File)
Mon, Nov 3, 11:16 PM
Unknown Object (File)
Fri, Oct 31, 6:26 PM
Unknown Object (File)
Oct 20 2025, 6:07 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