Page MenuHomeFreeBSD

Start to clean up arm64 address space selection
ClosedPublic

Authored by andrew on Wed, Jul 14, 3:20 PM.

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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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

sys/arm64/arm64/pmap.c
475–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.

509–510

Ditto.

sys/arm64/include/vmparam.h
160

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

Update based on comments from alc

This revision is now accepted and ready to land.Thu, Jul 15, 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.