openvmm_hcl/main.rs
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4//! User-mode VMM process that runs inside OpenHCL's Linux VTL2 environment.
5//!
6//! This binary links the OpenHCL resource resolvers and delegates to
7//! `underhill_entry`, which starts the workers that manage the VTL0 guest and
8//! paravisor services. It is a Linux component of the OpenHCL firmware image,
9//! not the host-side `openvmm` CLI.
10//!
11//! The supported build path is `cargo xflowey build-igvm <recipe>`, which
12//! selects features, builds this executable for the OpenHCL userspace, and
13//! packages it with the boot loader, kernel, initrd, and other measured
14//! resources. Non-Linux builds contain only an unsupported-platform stub.
15
16#![forbid(unsafe_code)]
17
18// Link resources.
19#[cfg(target_os = "linux")]
20use openvmm_hcl_resources as _;
21
22// OpenVMM-HCL only needs libcrypto from openssl, not libssl.
23#[cfg(target_os = "linux")]
24openssl_crypto_only::openssl_crypto_only!();
25
26#[cfg(all(not(test), target_os = "linux"))]
27crypto::ensure_single_backend!();
28
29#[cfg(not(target_os = "linux"))]
30fn main() {
31 unimplemented!("openvmm_hcl only runs on Linux");
32}
33
34#[cfg(target_os = "linux")]
35use underhill_entry::underhill_main as main;