Page MenuHomeFreeBSD

arm64: Reduce the kernel executable pages
ClosedPublic

Authored by andrew on May 2 2024, 4:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 12, 10:20 AM
Unknown Object (File)
Sun, Jun 1, 4:05 PM
Unknown Object (File)
Sat, May 31, 4:07 PM
Unknown Object (File)
Tue, May 20, 6:16 PM
Unknown Object (File)
May 12 2025, 1:49 PM
Unknown Object (File)
May 11 2025, 1:50 PM
Unknown Object (File)
May 11 2025, 11:33 AM
Unknown Object (File)
May 9 2025, 1:26 PM
Subscribers

Details

Summary

When creating the kernel page tables we create them all executable to
allow the kernel to boot.

We can reduce the number of l2 blocks or l3 pages created as executable
by looking where the end of the .text section is and only marking
memory up to this as executable (rounded up to the block/page size).

Memory after the .text is marked as execute never as it will be data.

Sponsored by: Arm Ltd

Diff Detail

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

Event Timeline

andrew requested review of this revision.May 2 2024, 4:10 PM

I assume that's supposed to be "l2 blocks" in the comment message?

And I guess it's really marking memory beyond this (rounded up end of .text) as non-executable

Rebase + move mov x10, x25 from D45062 to this patch

This revision is now accepted and ready to land.Wed, Jun 11, 7:31 PM
This revision was automatically updated to reflect the committed changes.