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: f0239f1 Previous: 2e23902 Performance Ratio
startup_benchmark Build Time 80.59 s 80.34 s 1.00
startup_benchmark File Size 0.80 MB 0.80 MB 1.00
Startup Time - 1 core 0.74 s (±0.02 s) 0.75 s (±0.02 s) 0.99
Startup Time - 2 cores 0.74 s (±0.03 s) 0.74 s (±0.02 s) 1.01
Startup Time - 4 cores 0.74 s (±0.02 s) 0.74 s (±0.02 s) 1.00
multithreaded_benchmark Build Time 83.09 s 82.11 s 1.01
multithreaded_benchmark File Size 0.89 MB 0.86 MB 1.04
Multithreaded Pi Efficiency - 2 Threads 89.41 % (±5.97 %) 85.89 % (±6.61 %) 1.04
Multithreaded Pi Efficiency - 4 Threads 44.80 % (±2.68 %) 43.43 % (±2.56 %) 1.03
Multithreaded Pi Efficiency - 8 Threads 25.67 % (±1.49 %) 25.76 % (±1.53 %) 1.00
micro_benchmarks Build Time 82.26 s 80.40 s 1.02
micro_benchmarks File Size 0.90 MB 0.86 MB 1.04
Scheduling time - 1 thread 65.27 ticks (±2.73 ticks) 62.65 ticks (±4.06 ticks) 1.04
Scheduling time - 2 threads 36.40 ticks (±4.38 ticks) 34.08 ticks (±4.10 ticks) 1.07
Micro - Time for syscall (getpid) 3.37 ticks (±0.62 ticks) 3.45 ticks (±0.58 ticks) 0.98
Memcpy speed - (built_in) block size 4096 77737.11 MByte/s (±54243.70 MByte/s) 82448.38 MByte/s (±56997.13 MByte/s) 0.94
Memcpy speed - (built_in) block size 1048576 30600.93 MByte/s (±24694.13 MByte/s) 30585.98 MByte/s (±24707.84 MByte/s) 1.00
Memcpy speed - (built_in) block size 16777216 27465.95 MByte/s (±22702.98 MByte/s) 26340.06 MByte/s (±21720.96 MByte/s) 1.04
Memset speed - (built_in) block size 4096 78265.13 MByte/s (±54604.17 MByte/s) 82292.76 MByte/s (±56891.50 MByte/s) 0.95
Memset speed - (built_in) block size 1048576 31338.52 MByte/s (±25121.09 MByte/s) 31323.85 MByte/s (±25145.86 MByte/s) 1.00
Memset speed - (built_in) block size 16777216 28239.54 MByte/s (±23182.23 MByte/s) 27104.68 MByte/s (±22209.94 MByte/s) 1.04
Memcpy speed - (rust) block size 4096 75426.93 MByte/s (±52553.87 MByte/s) 74097.96 MByte/s (±51811.44 MByte/s) 1.02
Memcpy speed - (rust) block size 1048576 30391.77 MByte/s (±24538.15 MByte/s) 30361.60 MByte/s (±24602.37 MByte/s) 1.00
Memcpy speed - (rust) block size 16777216 27277.87 MByte/s (±22567.60 MByte/s) 27625.34 MByte/s (±22806.88 MByte/s) 0.99
Memset speed - (rust) block size 4096 75844.51 MByte/s (±52854.23 MByte/s) 74373.47 MByte/s (±51976.48 MByte/s) 1.02
Memset speed - (rust) block size 1048576 31121.33 MByte/s (±24970.51 MByte/s) 31110.89 MByte/s (±25033.24 MByte/s) 1.00
Memset speed - (rust) block size 16777216 28056.01 MByte/s (±23052.28 MByte/s) 28386.93 MByte/s (±23265.03 MByte/s) 0.99
alloc_benchmarks Build Time 75.93 s 74.76 s 1.02
alloc_benchmarks File Size 0.87 MB 0.87 MB 1
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 5848.77 Ticks (±83.76 Ticks) 5860.58 Ticks (±98.43 Ticks) 1.00
Allocations - Average Allocation time (no fail) 6609.37 Ticks (±115.16 Ticks) 6554.81 Ticks (±92.86 Ticks) 1.01
Allocations - Average Deallocation time 1924.30 Ticks (±253.78 Ticks) 1805.01 Ticks (±250.35 Ticks) 1.07
mutex_benchmark Build Time 76.30 s 79.82 s 0.96
mutex_benchmark File Size 0.90 MB 0.86 MB 1.04
Mutex Stress Test Average Time per Iteration - 1 Threads 12.02 ns (±0.42 ns) 12.10 ns (±0.41 ns) 0.99
Mutex Stress Test Average Time per Iteration - 2 Threads 41.66 ns (±2.34 ns) 40.26 ns (±1.68 ns) 1.03

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 2 times, most recently from f22e6c5 to 20127b4 Compare July 11, 2026 10:54
@sbutz sbutz force-pushed the sb/virtio_entropy branch from 20127b4 to f0239f1 Compare July 11, 2026 11:52
@sbutz

sbutz commented Jul 11, 2026

Copy link
Copy Markdown
Author

@mkroening is there a way to execute all clippy ci targets locally?

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