Page MenuHomeFreeBSD

vm: Support swapping arm64 MTE tags
Needs ReviewPublic

Authored by andrew on Mar 19 2026, 4:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 4, 12:44 PM
Unknown Object (File)
Mon, Jun 1, 3:53 AM
Unknown Object (File)
Tue, May 19, 6:54 PM
Unknown Object (File)
Sat, May 16, 8:40 PM
Unknown Object (File)
Sat, May 16, 5:49 PM
Unknown Object (File)
Thu, May 14, 10:37 AM
Unknown Object (File)
Wed, May 13, 10:06 AM
Unknown Object (File)
Wed, May 13, 5:01 AM
Subscribers

Details

Reviewers
manu
alc
kib
markj
Group Reviewers
arm64
cheri
Summary

When we swap out a page containing MTE tags we need to keep a copy of
them to be restored when the page is later restored. Add support to
allocate per-page tag storage that is used when a MTE tagged page is
moved to swap and populate this with the pages tags.

Sponsored by: Arm Ltd

Diff Detail

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

Event Timeline

Is this something cheri could use too?

In CheriBSD we have a somewhat different mechanism where we embed the tags in struct swblk due to a hesitance to add more allocation to the swap path. That's not great for memory usage since it's quite a lot of space and it should be fairly compressible in most cases. I'd expect MTE to be before more compressible given it's often going to be runs of the same value. I think we could adapt this code to add CHERI tags, likely in parallel, though maybe with a shared scan loop.