K 10 svn:author V 2 mw K 8 svn:date V 27 2021-10-17T18:49:33.518058Z K 7 svn:log V 1099 pci_user: call bus_translate_resource before BAR mmap On some armv8 machines it is possible that the mapping between CPU and PCI bus BAR base addresses is not 1:1. In case 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 Marvell SoCs (Armada 7k8k/CN913x) and possibly many other platforms. Submitted by: Kornel Duleba Reviewed by: kib Obtained from: Semihalf Sponsored by: Marvell MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29604 (cherry picked from commit f2f1ab39c04088ce53287528549e652cf68cee09) pci_user: fix build for 32-bit platforms Commit: f2f1ab39c040 ("pci_user: call bus_translate_resource before BAR mmap") broke build for 32-bit platforms due to rman_res_t and vm_paddr_t incompatible types. Fix that. (cherry picked from commit 9857e00a528bb230c8935ded5f118a7374bf808b) Git Hash: 14721190e8298199a6cfbb6d2568ea1d17e7a107 Git Author: mw@FreeBSD.org END