Page MenuHomeFreeBSD

Add a way to map arm64 non-posted device memory
ClosedPublic

Authored by andrew on Apr 12 2021, 9:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 13, 9:14 AM
Unknown Object (File)
Oct 8 2024, 6:39 AM
Unknown Object (File)
Oct 3 2024, 9:57 PM
Unknown Object (File)
Oct 3 2024, 8:52 AM
Unknown Object (File)
Sep 8 2024, 4:27 AM
Unknown Object (File)
Sep 7 2024, 1:15 PM
Unknown Object (File)
Sep 5 2024, 8:38 PM
Unknown Object (File)
Aug 25 2024, 8:38 PM
Subscribers

Details

Summary

On arm64 we currently use a non-posted write for device memory, however
we should move to use posted writes. This is expected to work on most
hardware, however we will need to support a non-posted option for some
broken hardware.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38530
Build 35419: arc lint + arc unit

Event Timeline

Pass ma to pmap_mapdev_attr

bcr added a subscriber: bcr.

OK from manpages.

sys/arm64/include/vm.h
44

They are both the same, is that a typo ?

sys/arm64/include/vm.h
44

I'm planning on changing VM_MEMATTR_DEVICE to VM_MEMATTR_DEVICE_nGnRE, but need to update the PCIe drivers to use non-posted memory for their config space first.

manu added inline comments.
sys/arm64/include/vm.h
44

Ok thanks, maybe include that in the commit message so people don't ask the same question as me :)

This revision is now accepted and ready to land.Apr 12 2021, 11:51 AM
  • Teach vmstat about VM_MEMATTR_DEVICE_NP
  • Add a comment explaining why the device meory types are the same
This revision now requires review to proceed.Apr 12 2021, 1:43 PM
This revision is now accepted and ready to land.Apr 12 2021, 3:01 PM

We'll never have 'old broken devices' needing to use the BUS_SPACE_MAP_NONPOSTED attribute any place except arm64 because that's the only place they could possibly be, right?
Do we have any notion of which devices might be like this? Or is this a easy to do patch that allows quick 'CYA' fixes later if one remains hidden?

It's needed by the Tegra PCIe driver as it maps its config space via bus_space_map. The other PCI drivers use bus_alloc_resource_any for their config space so can be updated to use RF_UNMAPPED and bus_map_resource.