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
F174987949: D29604.id86910.diff
Wed, Oct 7, 10:28 AM
Unknown Object (File)
Fri, Sep 25, 5:13 PM
Unknown Object (File)
Wed, Sep 23, 6:53 PM
Unknown Object (File)
Sat, Sep 12, 8:53 AM
Unknown Object (File)
Mon, Sep 7, 1:54 PM
Unknown Object (File)
Sep 1 2026, 3:39 PM
Unknown Object (File)
Aug 27 2026, 1:09 AM
Unknown Object (File)
Aug 16 2026, 9:54 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