Skip to content

Use vm_memory crate instead of in-house#1199

Merged
jounathaen merged 3 commits intomainfrom
vmm-mem
Jan 28, 2026
Merged

Use vm_memory crate instead of in-house#1199
jounathaen merged 3 commits intomainfrom
vmm-mem

Conversation

@jounathaen
Copy link
Copy Markdown
Member

@jounathaen jounathaen commented Dec 18, 2025

Extracted from #643

Honestly, I'm not a 100% fan of this, but we need this in order to use vmm-mem's virtqueue abstractions in #643

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 89.16667% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.57%. Comparing base (c0666c5) to head (712d9cf).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/linux/x86_64/kvm_cpu.rs 56.25% 7 Missing ⚠️
src/mem.rs 95.34% 4 Missing ⚠️
src/arch/x86_64/paging/mod.rs 75.00% 1 Missing ⚠️
src/vm.rs 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1199      +/-   ##
==========================================
+ Coverage   76.82%   77.57%   +0.75%     
==========================================
  Files          26       26              
  Lines        3667     3675       +8     
==========================================
+ Hits         2817     2851      +34     
+ Misses        850      824      -26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jounathaen jounathaen force-pushed the vmm-mem branch 9 times, most recently from e6b711f to e458d49 Compare December 18, 2025 14:36
@jounathaen jounathaen marked this pull request as ready for review December 18, 2025 14:52
fogti
fogti previously requested changes Dec 19, 2025
Copy link
Copy Markdown
Contributor

@fogti fogti left a comment

Choose a reason for hiding this comment

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

Having three address types for guest addresses certainly makes stuff more confusing... Would it be possible to get rid of one?

@jounathaen
Copy link
Copy Markdown
Member Author

Having three address types for guest addresses certainly makes stuff more confusing... Would it be possible to get rid of one?

Yeah. I really hate it. But the vm_memory crate uses a different type than the kernel. So we can't use the same type in uhyve-interface without changing it in the kernel, and I would rather not include a new dependency in the kernel just for the type alias, and the current address type is "better" than the vm_memory one.

@fogti
Copy link
Copy Markdown
Contributor

fogti commented Dec 29, 2025

re: my proposal of the vm_memory dependency in uhyve-interface: One could also make the dependency optional, and provide From/Into conversion implementations there (and perhaps a few utility functions, albeit I haven't looked (yet) into which ones would be useful).

@jounathaen jounathaen force-pushed the vmm-mem branch 2 times, most recently from 3f495ad to 4c563c2 Compare January 22, 2026 13:18
@jounathaen
Copy link
Copy Markdown
Member Author

jounathaen commented Jan 22, 2026

@fogti So now I've changed this PR so that we still use our MmapMemory struct within Uhyve, but it uses the vmm-mem types internally. What do you think? Does this resolve the issue with the three address types?

@jounathaen jounathaen force-pushed the vmm-mem branch 2 times, most recently from dd6db09 to 8501cc5 Compare January 22, 2026 15:24
@fogti
Copy link
Copy Markdown
Contributor

fogti commented Jan 22, 2026

It does solve the issue with the address types.

@jounathaen jounathaen force-pushed the vmm-mem branch 6 times, most recently from 4a1d2eb to 3c8c590 Compare January 26, 2026 10:04
@jounathaen jounathaen force-pushed the vmm-mem branch 2 times, most recently from 58ae306 to f763ee4 Compare January 26, 2026 10:11
@fogti
Copy link
Copy Markdown
Contributor

fogti commented Jan 26, 2026

That are a lot of force pushes...

@jounathaen
Copy link
Copy Markdown
Member Author

May the force be with me...

I guess this is ready now?

@jounathaen jounathaen dismissed fogti’s stale review January 28, 2026 10:39

All should be implemented by now. As we can still improve stuff later, let's merge it!

@jounathaen jounathaen added this pull request to the merge queue Jan 28, 2026
Merged via the queue into main with commit a5e6def Jan 28, 2026
10 checks passed
@jounathaen jounathaen deleted the vmm-mem branch January 28, 2026 10:43
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