Skip to content

fix(mmio)#2255

Open
edef1c wants to merge 2 commits intohermit-os:mainfrom
edef1c:push-tmolxxwyrpqn
Open

fix(mmio)#2255
edef1c wants to merge 2 commits intohermit-os:mainfrom
edef1c:push-tmolxxwyrpqn

Conversation

@edef1c
Copy link

@edef1c edef1c commented Feb 16, 2026

  1. In check_linux_args, we return VAs to the free list while a VolatileRef to them is active. This breaks multi-device configurations. A similar bug exists in guess_device, but the current version of this patch doesn't fix it, since my reference target supplies mmio args.
  2. Per virtio spec 4.2.3.1, after writing 0 to the status register the driver must wait for the read-back to return 0 before considering the reset complete. We should spin until it does.

Per virtio spec 4.2.3.1, after writing 0 to the status register the
driver must wait for the read-back to return 0 before considering
the reset complete. Spin until it does.
@edef1c edef1c force-pushed the push-tmolxxwyrpqn branch 2 times, most recently from 93ff14c to 5aa7ecd Compare February 16, 2026 01:14
check_linux_args MMIO device registers into a PageBox-allocated VA,
then return a VolatileRef<'static> pointing at it. When the PageBox
is dropped, the VA range goes back to the free list. A subsequent
allocation could reuse and remap the same VA, corrupting the driver's
VolatileRef.

Use into_raw() to prevent the VA from being reclaimed when a device
is found.
Copy link
Contributor

@github-actions github-actions bot left a comment

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: 253b948 Previous: 4912505 Performance Ratio
startup_benchmark Build Time 102.52 s 99.11 s 1.03
startup_benchmark File Size 0.86 MB 0.86 MB 1.00
Startup Time - 1 core 0.96 s (±0.04 s) 0.96 s (±0.03 s) 1.00
Startup Time - 2 cores 0.96 s (±0.03 s) 0.96 s (±0.03 s) 0.99
Startup Time - 4 cores 0.96 s (±0.03 s) 0.96 s (±0.02 s) 1.00
multithreaded_benchmark Build Time 100.83 s 102.01 s 0.99
multithreaded_benchmark File Size 0.95 MB 0.95 MB 1.00
Multithreaded Pi Efficiency - 2 Threads 88.53 % (±7.35 %) 85.65 % (±8.90 %) 1.03
Multithreaded Pi Efficiency - 4 Threads 43.74 % (±3.81 %) 43.12 % (±3.13 %) 1.01
Multithreaded Pi Efficiency - 8 Threads 25.20 % (±2.21 %) 25.03 % (±1.95 %) 1.01
micro_benchmarks Build Time 104.99 s 114.00 s 0.92
micro_benchmarks File Size 0.96 MB 0.96 MB 1.00
Scheduling time - 1 thread 69.68 ticks (±3.25 ticks) 70.19 ticks (±3.58 ticks) 0.99
Scheduling time - 2 threads 38.35 ticks (±4.15 ticks) 38.99 ticks (±4.43 ticks) 0.98
Micro - Time for syscall (getpid) 2.89 ticks (±0.26 ticks) 2.96 ticks (±0.24 ticks) 0.98
Memcpy speed - (built_in) block size 4096 62722.07 MByte/s (±45057.38 MByte/s) 64026.03 MByte/s (±45553.92 MByte/s) 0.98
Memcpy speed - (built_in) block size 1048576 29877.34 MByte/s (±24635.09 MByte/s) 29743.12 MByte/s (±24826.10 MByte/s) 1.00
Memcpy speed - (built_in) block size 16777216 28459.33 MByte/s (±23707.11 MByte/s) 24007.89 MByte/s (±20230.77 MByte/s) 1.19
Memset speed - (built_in) block size 4096 63280.76 MByte/s (±45440.59 MByte/s) 64637.10 MByte/s (±45951.78 MByte/s) 0.98
Memset speed - (built_in) block size 1048576 30666.10 MByte/s (±25102.97 MByte/s) 30516.60 MByte/s (±25260.76 MByte/s) 1.00
Memset speed - (built_in) block size 16777216 29240.52 MByte/s (±24158.52 MByte/s) 24779.16 MByte/s (±20739.68 MByte/s) 1.18
Memcpy speed - (rust) block size 4096 61864.35 MByte/s (±45240.77 MByte/s) 60077.78 MByte/s (±44331.51 MByte/s) 1.03
Memcpy speed - (rust) block size 1048576 29667.37 MByte/s (±24499.80 MByte/s) 29870.69 MByte/s (±24878.06 MByte/s) 0.99
Memcpy speed - (rust) block size 16777216 28477.88 MByte/s (±23719.86 MByte/s) 24212.89 MByte/s (±20297.89 MByte/s) 1.18
Memset speed - (rust) block size 4096 62696.50 MByte/s (±45746.48 MByte/s) 60925.02 MByte/s (±44834.41 MByte/s) 1.03
Memset speed - (rust) block size 1048576 30438.95 MByte/s (±24950.58 MByte/s) 30651.78 MByte/s (±25309.43 MByte/s) 0.99
Memset speed - (rust) block size 16777216 29255.32 MByte/s (±24167.74 MByte/s) 24986.00 MByte/s (±20809.17 MByte/s) 1.17
alloc_benchmarks Build Time 103.84 s 105.28 s 0.99
alloc_benchmarks File Size 0.93 MB 0.93 MB 1.00
Allocations - Allocation success 100.00 % 100.00 % 1
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 100.00 % 100.00 % 1
Allocations - Average Allocation time 12088.91 Ticks (±192.04 Ticks) 9727.01 Ticks (±267.20 Ticks) 1.24
Allocations - Average Allocation time (no fail) 12088.91 Ticks (±192.04 Ticks) 9727.01 Ticks (±267.20 Ticks) 1.24
Allocations - Average Deallocation time 1087.80 Ticks (±546.23 Ticks) 2219.93 Ticks (±959.95 Ticks) 0.49
mutex_benchmark Build Time 103.31 s 104.33 s 0.99
mutex_benchmark File Size 0.96 MB 0.96 MB 1.00
Mutex Stress Test Average Time per Iteration - 1 Threads 12.82 ns (±0.59 ns) 12.84 ns (±0.76 ns) 1.00
Mutex Stress Test Average Time per Iteration - 2 Threads 15.66 ns (±0.74 ns) 15.44 ns (±0.78 ns) 1.01

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant