Page MenuHomeFreeBSD

arm64: Support TBI in userspace
ClosedPublic

Authored by andrew on Jul 30 2025, 4:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 1:15 AM
Unknown Object (File)
Sun, Oct 12, 1:15 AM
Unknown Object (File)
Sun, Oct 12, 1:15 AM
Unknown Object (File)
Sat, Oct 11, 3:44 PM
Unknown Object (File)
Fri, Oct 3, 6:17 PM
Unknown Object (File)
Thu, Oct 2, 12:42 AM
Unknown Object (File)
Wed, Oct 1, 11:20 PM
Unknown Object (File)
Mon, Sep 22, 11:59 PM
Subscribers

Details

Summary

To allow for Hardware-assisted AddressSanitizer (HWASAN) and future
work to enable MTE we need to enable TBI in userspace. As address space
that previously would have faulted will now not it could be considered
an ABI change so only enable for processes with a late enough revision.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

andrew added inline comments.
sys/arm64/arm64/efirt_machdep.c
254
sys/arm64/arm64/efirt_machdep.c
278

We now change it to set TBI. Should the comment be reworked?

sys/arm64/arm64/pmap.c
9163

Why didn't you invalidate the tlb like you did elsewhere? Other places you don't say why

andrew added inline comments.
sys/arm64/arm64/efirt_machdep.c
278

I think the only change needed here is to also mention curthread with curpmap

sys/arm64/arm64/pmap.c
9163

I only invalidate the TLB on exec as the tcr value may have changed from & the TLB may have cached the value from before the exec. I don't clear it here as it's just setting the value the TLB would have previously used.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 8 2025, 8:43 AM
This revision was automatically updated to reflect the committed changes.