Page MenuHomeFreeBSD

arm64: Support changing the DMAP memory type
Needs ReviewPublic

Authored by andrew on Mar 19 2026, 4:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 19, 8:52 PM
Unknown Object (File)
Sun, Apr 19, 8:52 PM
Unknown Object (File)
Sat, Apr 18, 1:25 PM
Unknown Object (File)
Sat, Apr 18, 6:07 AM
Unknown Object (File)
Mon, Apr 13, 3:42 PM
Unknown Object (File)
Sun, Apr 12, 1:00 AM
Unknown Object (File)
Sat, Apr 11, 10:30 AM
Unknown Object (File)
Sat, Apr 11, 10:13 AM
Subscribers

Details

Reviewers
manu
alc
kib
markj
Group Reviewers
arm64
Summary

When MTE is enabled we will use the DMAP to manage tags. To be able to
read/write them we need to change the memory attribute to
VM_MEMATTR_TAGGED.

Support changing the DMAP memory type to values known to have
equivalent cache properties.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 72176
Build 69059: arc lint + arc unit

Event Timeline

sys/arm64/arm64/pmap.c
8326–8330

Please update this comment.

8464

Can the comment please explain why this is necessary?

8477

Suppose we update a range with mode == VM_MEMATTR_WRITE_BACK, and dmap_attr != VM_MEMATTR_WRITE_BACK. Then, a subsequent update of the same range with old_mode == VM_MEMATTR_WRITE_BACK will not update the DMAP entries, which seems like a bug.

sys/arm64/arm64/pmap.c
8477

The only way we can currently get here with old_mode != -1 is through pmap_change_dmap_attr so will have old_mode == dmap_attr so the memory will be updated.

If we find other uses for old_mode then we may need to be smarter about handling old_mode for DMAP regions.