Page MenuHomeFreeBSD

Start to clean up arm64 address space selection
ClosedPublic

Authored by andrew on Jul 14 2021, 3:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 10 2024, 6:29 AM
Unknown Object (File)
Feb 2 2024, 4:14 AM
Unknown Object (File)
Dec 20 2023, 3:45 AM
Unknown Object (File)
Dec 17 2023, 3:37 PM
Unknown Object (File)
Dec 13 2023, 9:19 PM
Unknown Object (File)
Dec 12 2023, 6:54 AM
Unknown Object (File)
Nov 4 2023, 11:31 PM
Unknown Object (File)
Oct 9 2023, 4:39 PM
Subscribers

Details

Summary

On arm64 we should use bit 55 of the address to decide if aan address
is a user or kernel address. Add a new macro with this check and a
second to ensure the address is in teh canonical form, i.e.
the top bits are all zero or all one.

This will help with supporting future cpu features, including Top
Byte Ignore, Pointer Authentication, and Memory Tagging.

Diff Detail

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

Event Timeline

Set an error in data_abort as we print it in the kernel case

sys/arm64/arm64/pmap.c
473–476

I would suggest moving this KASSERT() before the above comment. Otherwise, this KASSERT() sits between the comment and the KASSERT() immediately below that the comment explains.

507–510

Ditto.

sys/arm64/include/vmparam.h
161

This "it's" should be "its".

Update based on comments from alc

This revision is now accepted and ready to land.Jul 15 2021, 10:24 AM

On arm64 we should use bit 55 of the address to decide if aan address is a user or kernel address.

Could you explain a bit further? Where does that number come from?

In current use he hardware will use bits 63:48 in the virtual address to decide which ttbr register to use, however I'm adding pointer authentication support. In this case the hardware will change bits 63:56 and 54:48. As it keeps bit 55 we will need to use this to decide if an address is a user or kernel address when faulting.

It is similar with top byte ignore, however bits 63:56 of the virtual address are ignored when performing the translation.