Skip to content

Support virtio entropy device#2547

Draft
sbutz wants to merge 2 commits into
hermit-os:mainfrom
sbutz:sb/virtio_entropy
Draft

Support virtio entropy device#2547
sbutz wants to merge 2 commits into
hermit-os:mainfrom
sbutz:sb/virtio_entropy

Conversation

@sbutz

@sbutz sbutz commented Jul 10, 2026

Copy link
Copy Markdown

In virtualized deployments seed DRNG from entropy provided by host.

Tbh this driver is of limited use, but was good exercise to get started with virtio.

Arch mmio pci
x86_64
aarch64
riscv64 ❌ - pci not supported on risc-v

Support for pci devices on risc-v shall be added in a separate PR. Is there already a ticket for that?

Blocked by integration of rust-osdev/virtio-spec-rs#24 and new release of virtio-spec-rs.

Increases code duplication among virtio drivers. #2527 becomes even more pressing.

Commit shall be reverted when a new version of virtio-spec-rs is published.

@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: f22e6c5 Previous: 2e23902 Performance Ratio
startup_benchmark Build Time 81.50 s 80.34 s 1.01
startup_benchmark File Size 0.80 MB 0.80 MB 1.00
Startup Time - 1 core 0.73 s (±0.02 s) 0.75 s (±0.02 s) 0.98
Startup Time - 2 cores 0.75 s (±0.02 s) 0.74 s (±0.02 s) 1.01
Startup Time - 4 cores 0.75 s (±0.03 s) 0.74 s (±0.02 s) 1.02
multithreaded_benchmark Build Time 83.76 s 82.11 s 1.02
multithreaded_benchmark File Size 0.89 MB 0.86 MB 1.04
Multithreaded Pi Efficiency - 2 Threads 88.39 % (±6.07 %) 85.89 % (±6.61 %) 1.03
Multithreaded Pi Efficiency - 4 Threads 44.05 % (±2.67 %) 43.43 % (±2.56 %) 1.01
Multithreaded Pi Efficiency - 8 Threads 25.69 % (±1.33 %) 25.76 % (±1.53 %) 1.00
micro_benchmarks Build Time 82.18 s 80.40 s 1.02
micro_benchmarks File Size 0.89 MB 0.86 MB 1.04
Scheduling time - 1 thread 66.05 ticks (±3.21 ticks) 62.65 ticks (±4.06 ticks) 1.05
Scheduling time - 2 threads 37.21 ticks (±4.77 ticks) 34.08 ticks (±4.10 ticks) 1.09
Micro - Time for syscall (getpid) 3.38 ticks (±0.59 ticks) 3.45 ticks (±0.58 ticks) 0.98
Memcpy speed - (built_in) block size 4096 82382.36 MByte/s (±56950.53 MByte/s) 82448.38 MByte/s (±56997.13 MByte/s) 1.00
Memcpy speed - (built_in) block size 1048576 30510.55 MByte/s (±24681.83 MByte/s) 30585.98 MByte/s (±24707.84 MByte/s) 1.00
Memcpy speed - (built_in) block size 16777216 27214.74 MByte/s (±22495.83 MByte/s) 26340.06 MByte/s (±21720.96 MByte/s) 1.03
Memset speed - (built_in) block size 4096 82540.32 MByte/s (±57065.81 MByte/s) 82292.76 MByte/s (±56891.50 MByte/s) 1.00
Memset speed - (built_in) block size 1048576 31270.27 MByte/s (±25115.44 MByte/s) 31323.85 MByte/s (±25145.86 MByte/s) 1.00
Memset speed - (built_in) block size 16777216 27995.24 MByte/s (±22983.99 MByte/s) 27104.68 MByte/s (±22209.94 MByte/s) 1.03
Memcpy speed - (rust) block size 4096 77705.02 MByte/s (±54057.79 MByte/s) 74097.96 MByte/s (±51811.44 MByte/s) 1.05
Memcpy speed - (rust) block size 1048576 30497.11 MByte/s (±24690.90 MByte/s) 30361.60 MByte/s (±24602.37 MByte/s) 1.00
Memcpy speed - (rust) block size 16777216 27593.67 MByte/s (±22778.09 MByte/s) 27625.34 MByte/s (±22806.88 MByte/s) 1.00
Memset speed - (rust) block size 4096 77658.87 MByte/s (±54035.32 MByte/s) 74373.47 MByte/s (±51976.48 MByte/s) 1.04
Memset speed - (rust) block size 1048576 31261.38 MByte/s (±25132.65 MByte/s) 31110.89 MByte/s (±25033.24 MByte/s) 1.00
Memset speed - (rust) block size 16777216 28374.50 MByte/s (±23259.71 MByte/s) 28386.93 MByte/s (±23265.03 MByte/s) 1.00
alloc_benchmarks Build Time 75.47 s 74.76 s 1.01
alloc_benchmarks File Size 0.87 MB 0.87 MB 1.00
Allocations - Allocation success 91.31 % 91.31 % 1
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 61.44 % 61.44 % 1
Allocations - Average Allocation time 5538.91 Ticks (±109.22 Ticks) 5860.58 Ticks (±98.43 Ticks) 0.95
Allocations - Average Allocation time (no fail) 6194.60 Ticks (±124.85 Ticks) 6554.81 Ticks (±92.86 Ticks) 0.95
Allocations - Average Deallocation time 1360.28 Ticks (±321.62 Ticks) 1805.01 Ticks (±250.35 Ticks) 0.75
mutex_benchmark Build Time 75.09 s 79.82 s 0.94
mutex_benchmark File Size 0.90 MB 0.86 MB 1.04
Mutex Stress Test Average Time per Iteration - 1 Threads 12.00 ns (±0.00 ns) 12.10 ns (±0.41 ns) 0.99
Mutex Stress Test Average Time per Iteration - 2 Threads 41.72 ns (±2.22 ns) 40.26 ns (±1.68 ns) 1.04

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

@mkroening mkroening self-assigned this Jul 10, 2026
@sbutz sbutz force-pushed the sb/virtio_entropy branch from 52a17b2 to f22e6c5 Compare July 10, 2026 18:34
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.

2 participants