Skip to content

Stricter pagetable flags - #2754

Merged
stlankes merged 3 commits into
mainfrom
code-write-protect
Oct 29, 2026
Merged

stlankes merged 3 commits into
mainfrom
code-write-protect

Conversation

@jounathaen

Copy link
Copy Markdown
Member

Currently, almost all new memory mappings of Hermit are executable, and not all write-protection is done correctly.
This PR fixes the write-protection issue in mmap/mman and defaults all memory mappings to non-execute.

This is related to #275, but it doesn't fix it, since the code mappings must be done in the loader/Uhyve.

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Results

Details
Benchmark Current: 29cf858 Previous: 2e23902 Performance Ratio
startup_benchmark Build Time 84.87 s 80.34 s 1.06 ❗
startup_benchmark File Size 0.85 MB 0.80 MB 1.07 ❗
Startup Time - 1 core 0.73 s (±0.02 s) 0.75 s (±0.02 s) 0.97
Startup Time - 2 cores 0.72 s (±0.02 s) 0.74 s (±0.02 s) 0.98
Startup Time - 4 cores 0.73 s (±0.01 s) 0.74 s (±0.02 s) 0.98
multithreaded_benchmark Build Time 82.48 s 82.11 s 1.00 ❗
multithreaded_benchmark File Size 0.94 MB 0.86 MB 1.10 ❗
Multithreaded Pi Efficiency - 2 Threads 90.26 % (±8.80 %) 85.89 % (±6.61 %) 1.05
Multithreaded Pi Efficiency - 4 Threads 45.24 % (±2.46 %) 43.43 % (±2.56 %) 1.04
Multithreaded Pi Efficiency - 8 Threads 26.41 % (±1.31 %) 25.76 % (±1.53 %) 1.03
micro_benchmarks Build Time 83.23 s 80.40 s 1.04 ❗
micro_benchmarks File Size 0.94 MB 0.86 MB 1.10 ❗
Scheduling time - 1 thread 65.15 ticks (±3.48 ticks) 62.65 ticks (±4.06 ticks) 1.04
Scheduling time - 2 threads 36.78 ticks (±5.39 ticks) 34.08 ticks (±4.10 ticks) 1.08
Micro - Time for syscall (getpid) 3.41 ticks (±0.56 ticks) 3.45 ticks (±0.58 ticks) 0.99
Memcpy speed - (built_in) block size 4096 80435.81 MByte/s (±56357.14 MByte/s) 82448.38 MByte/s (±56997.13 MByte/s) 0.98
Memcpy speed - (built_in) block size 1048576 30227.14 MByte/s (±24358.74 MByte/s) 30585.98 MByte/s (±24707.84 MByte/s) 0.99
Memcpy speed - (built_in) block size 16777216 29149.39 MByte/s (±23997.19 MByte/s) 26340.06 MByte/s (±21720.96 MByte/s) 1.11
Memset speed - (built_in) block size 4096 80877.98 MByte/s (±56575.09 MByte/s) 82292.76 MByte/s (±56891.50 MByte/s) 0.98
Memset speed - (built_in) block size 1048576 30965.23 MByte/s (±24795.29 MByte/s) 31323.85 MByte/s (±25145.86 MByte/s) 0.99
Memset speed - (built_in) block size 16777216 29875.06 MByte/s (±24402.32 MByte/s) 27104.68 MByte/s (±22209.94 MByte/s) 1.10
Memcpy speed - (rust) block size 4096 75105.23 MByte/s (±52530.45 MByte/s) 74097.96 MByte/s (±51811.44 MByte/s) 1.01
Memcpy speed - (rust) block size 1048576 30036.00 MByte/s (±24309.61 MByte/s) 30361.60 MByte/s (±24602.37 MByte/s) 0.99
Memcpy speed - (rust) block size 16777216 29078.05 MByte/s (±23950.62 MByte/s) 27625.34 MByte/s (±22806.88 MByte/s) 1.05
Memset speed - (rust) block size 4096 75505.60 MByte/s (±52820.31 MByte/s) 74373.47 MByte/s (±51976.48 MByte/s) 1.02
Memset speed - (rust) block size 1048576 30792.38 MByte/s (±24755.63 MByte/s) 31110.89 MByte/s (±25033.24 MByte/s) 0.99
Memset speed - (rust) block size 16777216 29847.33 MByte/s (±24395.45 MByte/s) 28386.93 MByte/s (±23265.03 MByte/s) 1.05
alloc_benchmarks Build Time 85.95 s 74.76 s 1.15 ❗
alloc_benchmarks File Size 0.93 MB 0.87 MB 1.06 ❗
Allocations - Allocation success 91.37 % 91.31 % 1.00 ❗
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 61.61 % 61.44 % 1.00 ❗
Allocations - Average Allocation time 6576.67 Ticks (±177.28 Ticks) 5860.58 Ticks (±98.43 Ticks) 1.12 ❗
Allocations - Average Allocation time (no fail) 7097.65 Ticks (±174.99 Ticks) 6554.81 Ticks (±92.86 Ticks) 1.08 ❗
Allocations - Average Deallocation time 1187.44 Ticks (±306.59 Ticks) 1805.01 Ticks (±250.35 Ticks) 0.66 ❗
mutex_benchmark Build Time 82.62 s 79.82 s 1.04 ❗
mutex_benchmark File Size 0.94 MB 0.86 MB 1.10 ❗
Mutex Stress Test Average Time per Iteration - 1 Threads 12.04 ns (±0.20 ns) 12.10 ns (±0.41 ns) 1.00
Mutex Stress Test Average Time per Iteration - 2 Threads 65.90 ns (±3.46 ns) 40.26 ns (±1.68 ns) 1.64 ❗

This comment was automatically generated by workflow using github-action-benchmark.

@stlankes
stlankes added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 73546d9 Oct 29, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants