Skip to content

feat(uhyve): use v2 interface#2190

Open
n0toose wants to merge 1 commit intohermit-os:mainfrom
n0toose:uhyve-v2-io-with-rcx
Open

feat(uhyve): use v2 interface#2190
n0toose wants to merge 1 commit intohermit-os:mainfrom
n0toose:uhyve-v2-io-with-rcx

Conversation

@n0toose
Copy link
Member

@n0toose n0toose commented Jan 23, 2026

On x86_64, the data address will be stored in the rcx register to support 64-bit addresses.

This also removes the usage of ExitArgs, as it is a single integer.

@n0toose
Copy link
Member Author

n0toose commented Jan 23, 2026

Succeeds #2013

Copy link

@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: 12fe5b1 Previous: e0ce538 Performance Ratio
startup_benchmark Build Time 89.15 s 88.64 s 1.01
startup_benchmark File Size 0.77 MB 0.78 MB 0.98
Startup Time - 1 core 0.97 s (±0.02 s) 0.96 s (±0.03 s) 1.01
Startup Time - 2 cores 0.95 s (±0.03 s) 0.96 s (±0.04 s) 0.99
Startup Time - 4 cores 0.96 s (±0.04 s) 0.98 s (±0.03 s) 0.99
multithreaded_benchmark Build Time 91.19 s 90.67 s 1.01
multithreaded_benchmark File Size 0.89 MB 0.89 MB 1.00
Multithreaded Pi Efficiency - 2 Threads 92.70 % (±8.25 %) 88.34 % (±9.63 %) 1.05
Multithreaded Pi Efficiency - 4 Threads 44.82 % (±4.09 %) 43.35 % (±2.77 %) 1.03
Multithreaded Pi Efficiency - 8 Threads 25.63 % (±2.48 %) 25.17 % (±2.41 %) 1.02
micro_benchmarks Build Time 101.63 s 100.90 s 1.01
micro_benchmarks File Size 0.90 MB 0.90 MB 1.00
Scheduling time - 1 thread 72.84 ticks (±4.23 ticks) 73.66 ticks (±4.85 ticks) 0.99
Scheduling time - 2 threads 39.68 ticks (±5.44 ticks) 38.61 ticks (±3.13 ticks) 1.03
Micro - Time for syscall (getpid) 3.00 ticks (±0.27 ticks) 3.92 ticks (±0.20 ticks) 0.76
Memcpy speed - (built_in) block size 4096 63839.54 MByte/s (±45358.10 MByte/s) 60742.27 MByte/s (±42902.76 MByte/s) 1.05
Memcpy speed - (built_in) block size 1048576 29466.91 MByte/s (±24671.87 MByte/s) 30041.63 MByte/s (±25084.98 MByte/s) 0.98
Memcpy speed - (built_in) block size 16777216 22808.82 MByte/s (±18915.94 MByte/s) 22962.35 MByte/s (±19327.03 MByte/s) 0.99
Memset speed - (built_in) block size 4096 64075.10 MByte/s (±45488.32 MByte/s) 61460.72 MByte/s (±43387.59 MByte/s) 1.04
Memset speed - (built_in) block size 1048576 30245.82 MByte/s (±25097.01 MByte/s) 30843.30 MByte/s (±25532.01 MByte/s) 0.98
Memset speed - (built_in) block size 16777216 23449.68 MByte/s (±19313.19 MByte/s) 23720.59 MByte/s (±19854.83 MByte/s) 0.99
Memcpy speed - (rust) block size 4096 56742.04 MByte/s (±42014.88 MByte/s) 58684.11 MByte/s (±43425.02 MByte/s) 0.97
Memcpy speed - (rust) block size 1048576 29412.15 MByte/s (±24620.81 MByte/s) 29918.21 MByte/s (±25119.12 MByte/s) 0.98
Memcpy speed - (rust) block size 16777216 21612.02 MByte/s (±17905.12 MByte/s) 23297.77 MByte/s (±19599.55 MByte/s) 0.93
Memset speed - (rust) block size 4096 57623.31 MByte/s (±42560.27 MByte/s) 58975.02 MByte/s (±43585.57 MByte/s) 0.98
Memset speed - (rust) block size 1048576 30215.24 MByte/s (±25060.57 MByte/s) 30705.41 MByte/s (±25550.79 MByte/s) 0.98
Memset speed - (rust) block size 16777216 22156.10 MByte/s (±18229.85 MByte/s) 24054.41 MByte/s (±20114.49 MByte/s) 0.92
alloc_benchmarks Build Time 92.46 s 98.25 s 0.94
alloc_benchmarks File Size 0.84 MB 0.85 MB 0.98
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 12351.18 Ticks (±503.53 Ticks) 9975.44 Ticks (±278.92 Ticks) 1.24
Allocations - Average Allocation time (no fail) 12351.18 Ticks (±503.53 Ticks) 9975.44 Ticks (±278.92 Ticks) 1.24
Allocations - Average Deallocation time 5410.77 Ticks (±736.45 Ticks) 1930.66 Ticks (±1176.47 Ticks) 2.80
mutex_benchmark Build Time 92.17 s 92.55 s 1.00
mutex_benchmark File Size 0.90 MB 0.90 MB 1.00
Mutex Stress Test Average Time per Iteration - 1 Threads 13.16 ns (±0.64 ns) 13.04 ns (±0.87 ns) 1.01
Mutex Stress Test Average Time per Iteration - 2 Threads 20.46 ns (±8.14 ns) 19.26 ns (±7.84 ns) 1.06

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

@jounathaen
Copy link
Member

LGTM!

@n0toose could you maybe fix the clippy error?

@n0toose n0toose force-pushed the uhyve-v2-io-with-rcx branch 2 times, most recently from 26f6184 to 6ee7a13 Compare March 14, 2026 16:52
On x86_64, the data address will be stored in the rdi register
to support 64-bit addresses.

This also removes the usage of ExitArgs, as it is a single integer.

We additionally introduce improved, more POSIX-compliant-ish error
handling together, more debugging messages and replaced the if..else
with matches for readability reasons.

Co-authored-by: Ellen Εμιλία Άννα Zscheile <fogti+devel@ytrizja.de>
Helped-by: Jonathan Klimt <jonathan.klimt@eonerc.rwth-aachen.de>
@n0toose n0toose force-pushed the uhyve-v2-io-with-rcx branch from 6ee7a13 to 12fe5b1 Compare March 14, 2026 19:28
@n0toose
Copy link
Member Author

n0toose commented Mar 14, 2026

All Uhyve tests pass on x86_64 (apart from memory with this branch, which was fully expected): https://github.com/hermit-os/uhyve/blob/c5d573701e479e4ae1c8974bec80742ee928cff0/tests/memory.rs#L29-L30

I have not confirmed the same for macOS/aarch64 (yet), for which a small modification to account for 64-bytes was made: https://github.com/hermit-os/kernel/pull/2190/changes#diff-3f8326589ecec56a9d94f21f100834839de00873cd3eb7d653c09e962450876bR81

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.

3 participants