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)
Fri, Nov 15, 9:42 PM
Unknown Object (File)
Fri, Nov 15, 8:43 PM
Unknown Object (File)
Tue, Nov 12, 9:55 AM
Unknown Object (File)
Tue, Nov 12, 5:45 AM
Unknown Object (File)
Sun, Nov 10, 7:39 PM
Unknown Object (File)
Sun, Nov 10, 7:35 AM
Unknown Object (File)
Sat, Nov 9, 9:02 PM
Unknown Object (File)
Sat, Nov 9, 7:31 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.