Page MenuHomeFreeBSD

arm64: Create an L3 table to limit permissions
ClosedPublic

Authored by andrew on May 2 2024, 4:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 1, 1:06 PM
Unknown Object (File)
Tue, Jul 1, 5:50 AM
Unknown Object (File)
Mon, Jun 30, 3:10 PM
Unknown Object (File)
Mon, Jun 30, 8:26 AM
Unknown Object (File)
Sun, Jun 29, 8:51 PM
Unknown Object (File)
Sun, Jun 29, 6:07 AM
Unknown Object (File)
Fri, Jun 27, 10:58 AM
Unknown Object (File)
Tue, Jun 24, 9:18 AM
Subscribers

Details

Summary

When building a 4k page kernel we use 2M blocks to map the kernel
contents. As the .text section may not end on a 2M aligned address
we need to split one block into level 3 pages and pad the end of the
section to an appropriate boundary.

With both these changes we can then mapjust the code as executable.
While here also map it as read-only as none ofthis shouldbe written
to directly.

Sponsored by: Arm Ltd

Diff Detail

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

Event Timeline

sys/arm64/arm64/locore.S
965

This seems to be missing commit 94b09d3 that sets ATTR_CONTIGUOUS. That is now going to matter for the 4KB base page size.

sys/conf/ldscript.arm64
21
23

My one concern about this is hypothetical. Suppose that someone in the not-so-distant future tries to implement support for a base page size of 64KB. I suspect that they will fail to notice this until experience a mysterious failure. Is there a compelling reason not to use CONSTANT (MAXPAGESIZE) here instead?

Update based on feedback from @alc

This revision is now accepted and ready to land.Mon, Jun 16, 4:46 PM