Page MenuHomeFreeBSD

arm64: Set ATTR_CONTIGUOUS on the kernel code and data sections when the page size is 16K
ClosedPublic

Authored by alc on May 11 2024, 7:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 15, 5:35 PM
Unknown Object (File)
Mon, Nov 4, 3:05 AM
Unknown Object (File)
Sun, Nov 3, 9:21 PM
Unknown Object (File)
Sun, Nov 3, 12:35 AM
Unknown Object (File)
Thu, Oct 31, 8:38 PM
Unknown Object (File)
Oct 1 2024, 7:17 PM
Unknown Object (File)
Sep 26 2024, 11:06 AM
Unknown Object (File)
Sep 23 2024, 4:32 AM

Details

Summary

When the page size is 16K, map the kernel code and data sections using 2M pages. Previously, they were mapped using 16K pages.

Test Plan

Before:

vm.pmap.kernel_maps:
Kernel map:
0xffff000000000000-0xffff0000014b4000 rwx-sg     WB 0 0 0 1325
0xffff0000014b4000-0xffff0000014c4000 r---sg     WB 0 0 0 4
0xffff0000014c4000-0xffff0000014d0000 rwx-sg     WB 0 0 0 3
0xffff0000014d0000-0xffff0000014ec000 r-x-sg     WB 0 0 0 7
0xffff0000014ec000-0xffff0000014f4000 rwx-sg     WB 0 0 0 2
0xffff0000014f4000-0xffff0000014fc000 rw--sg     WB 0 0 0 2
0xffff0000014fc000-0xffff000001b40000 rwx-sg     WB 0 0 0 401
0xffff001002000000-0xffff001002010000 r---sg     WB 0 0 0 4
0xffff001002010000-0xffff0010020e8000 rw--sg     WB 0 0 0 54
0xffff0010020e8000-0xffff0010020f8000 rw--sg    DEV 0 0 0 4
0xffff0010020f8000-0xffff0010021f8000 rw--sg     WT 0 0 0 64
0xffff0010021f8000-0xffff0010021fc000 rw--sg     WB 0 0 0 1
0xffff001002200000-0xffff001003200000 rw--sg DEV-NP 0 0 8 0
0xffff001003f34000-0xffff001003f74000 rw--sg     WB 0 0 0 16
0xffff001004000000-0xffff00100a000000 rw--sg     WB 0 1 15 2176

After:

vm.pmap.kernel_maps: 
Kernel map:
0xffff000000000000-0xffff0000014b4000 rwx-sg     WB 0 0 10 45
0xffff0000014b4000-0xffff0000014c4000 r---sg     WB 0 0 0 4
0xffff0000014c4000-0xffff0000014d0000 rwx-sg     WB 0 0 0 3
0xffff0000014d0000-0xffff0000014ec000 r-x-sg     WB 0 0 0 7
0xffff0000014ec000-0xffff0000014f4000 rwx-sg     WB 0 0 0 2
0xffff0000014f4000-0xffff0000014fc000 rw--sg     WB 0 0 0 2
0xffff0000014fc000-0xffff000001b40000 rwx-sg     WB 0 0 2 145
0xffff001002000000-0xffff001002010000 r---sg     WB 0 0 0 4
0xffff001002010000-0xffff0010020e8000 rw--sg     WB 0 0 0 54
0xffff0010020e8000-0xffff0010020f8000 rw--sg    DEV 0 0 0 4
0xffff0010020f8000-0xffff0010021f8000 rw--sg     WT 0 0 0 64
0xffff0010021f8000-0xffff0010021fc000 rw--sg     WB 0 0 0 1
0xffff001002200000-0xffff001003200000 rw--sg DEV-NP 0 0 8 0
0xffff001003f34000-0xffff001003f74000 rw--sg     WB 0 0 0 16
0xffff001004000000-0xffff00100a000000 rw--sg     WB 0 1 15 2176

Diff Detail

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

Event Timeline

alc requested review of this revision.May 11 2024, 7:47 AM

On an Altra with this patch I see:

Kernel map:
0xffff000000000000-0xffff0000013e4000 rwx-sg     WB 0 0 9 121
0xffff0000013e4000-0xffff0000014d8000 r---sg     WB 0 0 0 61
0xffff0000014d8000-0xffff0000014e0000 rwx-sg     WB 0 0 0 2
0xffff0000014e0000-0xffff000001738000 r-x-sg     WB 0 0 0 150
0xffff000001738000-0xffff000001740000 rwx-sg     WB 0 0 0 2
0xffff000001740000-0xffff000001820000 rw--sg     WB 0 0 0 56
0xffff000001820000-0xffff000001f98000 rwx-sg     WB 0 0 2 222
0xffff001002000000-0xffff001002010000 r---sg     WB 0 0 0 4
sys/arm64/arm64/locore.S
813

It might be worth commenting here or at the beginning of the subroutine that we're making an assumption about the alignment of PA and VA here.

This revision is now accepted and ready to land.May 11 2024, 4:26 PM

Add requirements comment.

This revision now requires review to proceed.May 11 2024, 6:42 PM
alc marked an inline comment as done.May 11 2024, 6:43 PM
This revision is now accepted and ready to land.May 12 2024, 3:10 PM