-
Notifications
You must be signed in to change notification settings - Fork 130
Creates hyperlight-guest-bin
crate
#545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@jprendes ~ for this PR, we'll have to reserve |
8e14ab3
to
2a75b5e
Compare
2a75b5e
to
9e6739f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor comments LGTM , lets get one other person to look at it before we merge it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
a47e6a7
to
adaa29f
Compare
It's currently hard to use the guest library. For instance, it defines a panic handler, which will cause compilation errors if a user of the library already has one defined. This commit creates a new crate to house the opinionated bits of the guest library to make its base functionality (i.e., causing VM exits, calling host functions) easier to consume without sacrificing functionality that currently exists in guest lib that makes writing guest apps easier. Aside from creating the crate, this commit also fixes up some doc references that referenced the guest lib alone. Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
…gger + exceptions + guest function logic + guest_err - moved entrypoint to guest_bin library. W/ this, I also moved a lot of things that were only used via the entrypoint: -- IDT/GDT setup for exceptions. -- guest_logger. - w/ the entrypoint fxn from the guest lib having moved, I re-named that module to 'exit' as it still contains stuff for aborting guest execution. I also moved OUT functions there like 'outb' and 'out32'. - a lot of our public functions in the guest lib, like, for example, push_shared_output_data relied on a pub(crate) global (i.e., P_PEB) being set. W/ that only ever being set in the entrypoint and w/ it not being appropriate as pub, I created a GuestHandle struct. This struct houses a *mut HyperlightPEB that operations like push_shared_output_data can leverage. bin-like crates can then create their own GuestHandle globals and use its functionality like self.push_shared_output_data(...). - moved all out guest function defintion, registration and so on to the guest_bin crate. Signed-off-by: danbugs <[email protected]>
This module defines C-wrappers for our global allocator, specific to the needs of our C-API and custom guests, so it makes sense to move it. Signed-off-by: danbugs <[email protected]>
guest lib should only contain basic functions to interact with the host. Whatever we decide to bring in as third_party deps belong in the guest_bin crate. Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
…ning function Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
adaa29f
to
a68ff5e
Compare
This PR splits the
hyperlight_guest
crate into two:(1) The core
hyperlight_guest
crate: It provides only the essential building blocks for interacting with the host environment, including the VM exit mechanism (outb
), abstractions for calling host functions and receiving return values, and the input/output stacks used for guest-host communication. This is the kind of crate that custom guests (e.g., Nanvix) can use to avoid duplicating code.(2) NEW The
hyperlight_guest_bin
crate: This crate contains the opinionated bits of the guest library, such as the panic handler, the entry point, the guest logger, the exception handling logic, and third_party code used by our C-API.Below is a diagram to help illustrate how guests can rely on functionalities of each crate.

It might help to review this PR commit-by-commit.