Page MenuHomeFreeBSD

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

Authored by alc on Sat, May 11, 7:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 19, 8:00 PM
Unknown Object (File)
Sat, May 18, 8:40 PM
Unknown Object (File)
Thu, May 16, 10:01 PM
Unknown Object (File)
Thu, May 16, 10:00 PM
Unknown Object (File)
Thu, May 16, 6:57 PM
Unknown Object (File)
Thu, May 16, 6:56 PM
Unknown Object (File)
Tue, May 14, 12:58 AM
Unknown Object (File)
Mon, May 13, 8:49 PM

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.Sat, May 11, 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.Sat, May 11, 4:26 PM

Add requirements comment.

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