feat: add xen-hvm crate for guest kernel definitions#17
feat: add xen-hvm crate for guest kernel definitions#17mkroening wants to merge 1 commit intorust-vmm:mainfrom
Conversation
|
CC: @TSnake41 |
e40a367 to
e72f304
Compare
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
|
I don't think the CI failure is caused by this PR. Perhaps the rust-vmm-ci submodule is outdated. Should I open a PR for fixing that, or would the maintainers rather do this themselves? :) |
|
I would prefer to have "PVH start_info" structures as a part of a separate crate/repository (thus non-xen-specific crate) as it has been adopted by cloud-hypervisor and alike; so it's not really Xen specific (even though xen create could eventually refer to it). Eventually in a new crate to be adopted by https://github.com/cloud-hypervisor/rust-hypervisor-firmware and (future) oxerun, but also cloud-hypervisor/others through https://github.com/rust-vmm/linux-loader (which has its own definition of this structure, but I guess we can use a single crate rather than having multiples definitions of the same structure). |
What does non-xen-specific mean here? That it should be independent of this repo or that it should not contain Xen in its name? The definitions are from Xen's HVM header after all; that's why I thought that xen-hvm as a crate name makes sense, even if other hypervisors use the same boot process (QEMU and users of the linux-loader crate at least).
Putting this crate somewhere else might make sense. Thanks for bringing that up! Would the Rust OSDev org sound like an appropriate place to you? I could talk to the other org members to discuss this. |
Ah ok; though
I like the idea of having it in Rust OSDev 👍. |
I see. It might make sense to keep any potential PV definitions separate from HVM definitions, though, right? Or do they share many definitions? I could not find any corresponding header files. I would prefer the short From the
Their corresponding paths with the
I'd prefer
Great! Once we agree on a name, I'll polish over the code some more and ask the other members if they agree with this crate living there. Then, I'll publish an initial version as a starting point. Does that sound good to you? :) |
Summary of the PR
This PR adds a new xen-hvm crate for definitions for guest kernels.
I am currently porting Hermit to support booting via PVH (hermit-os/loader#577). For that, it would be useful to have a crate specifically for entering a kernel via HVM.
The xen-hvm crate mainly contains definitions from xen/include/public/arch-x86/hvm/start_info.h, hence the name. The existing bindings in xen-bindings (such as
start_info) seem to be for different items.The crate is hand-written and has Rust-style names, with the docs still being searchable with the original names via
#[doc(alias = ...)]. The style is that of similar crates in the Rust OSDev org that I authored. If review bandwidth is limited or this OS-dev-centric crate does not fit this VMM-focused org, I can, of course, try to publish it at Rust OSDev or in my private namespace instead.I hope this PR is a helpful small step towards #16 that helps kernels boot in PVH separately from doing Xen hypercalls. As far as I am aware, that PR also does not provide the information from this PR in a separate crate for kernel consumption and instead defines these structs privately in oxerun/src/pvh.rs.
The PR in its current state should have the basic code in place. Before merging, I would take another pass over it, though, for polish and to add the appropriate metadata to the Cargo.toml. This PR is not marked as draft to discuss this approach in general and to find if it synergizes appropriately with #16.
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafecode is properly documented.