Skip to main content

nub_flat_guest_x86/
lib.rs

1//! The flat guest personality: nub's reference `GuestPersonality`,
2//! plugged into the generic guest kernel (`nub-arch-x86`).
3//!
4//! This is the half that runs inside the KVM sandbox in ring 0, owns
5//! the per-frame page table, and drives the x86-64 JIT. It is what
6//! makes nub's recompiler *executable* rather than merely
7//! *emittable* — without a `GuestPersonality` there is nobody to build
8//! a frame for the compiled code to run in.
9//!
10//! Four pieces, which is the whole obligation. Plain code spans, not
11//! doc links: every one of these modules is `cfg(target_os = "none")`
12//! and therefore absent from the host doc build that `cargo doc -D
13//! warnings` gates on.
14//!
15//! | module | trait | what it decides |
16//! |---|---|---|
17//! | `store` | `GuestStore` | how a published object is decoded and named |
18//! | `mem` | `FrameMem` | where a data page comes from, and how CoW works |
19//! | `frame` | `ExecFrame` | the address-space layout handed to the JIT |
20//! | `personality` | `GuestPersonality` | root frame, gas policy, exit meaning |
21//!
22//! Host-visible surface: only [`test_abi`]; everything else is
23//! `cfg(target_os = "none")`.
24
25#![cfg_attr(target_os = "none", no_std)]
26
27#[cfg(target_os = "none")]
28extern crate alloc; // register_guest_kernel! requirement
29#[cfg(target_os = "none")]
30extern crate hyperlight_guest_bin; // panic handler + allocator + macro paths
31
32#[cfg(target_os = "none")]
33pub mod frame;
34#[cfg(target_os = "none")]
35pub mod mem;
36#[cfg(target_os = "none")]
37pub mod personality;
38#[cfg(target_os = "none")]
39pub mod store;
40
41/// Production guest-function table (linkme contributions).
42#[cfg(target_os = "none")]
43pub mod guest_prod;
44
45/// Flat-private test fn_ids (band >= 0x100). Always compiled — the host
46/// side needs the constants.
47pub mod test_abi;