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)
Mar 19 2024, 12:35 AM
Unknown Object (File)
Jan 14 2024, 4:57 AM
Unknown Object (File)
Dec 22 2023, 11:17 PM
Unknown Object (File)
Dec 7 2023, 12:43 AM
Unknown Object (File)
Nov 27 2023, 8:59 PM
Unknown Object (File)
Nov 27 2023, 9:21 AM
Unknown Object (File)
Nov 25 2023, 11:58 AM
Unknown Object (File)
Nov 23 2023, 2:12 AM
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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.