Skip to content
Open
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
"boot/bootimg",
"boot/defs",
"cpuarch",
"paging",
# binary targets
"stage1",
"kernel",
Expand Down Expand Up @@ -55,6 +56,7 @@ bldr = { path = "boot/bldr" }
bootdefs = { path = "boot/defs" }
bootimg = { path = "boot/bootimg" }
cpuarch = { path = "cpuarch" }
paging = { path = "paging" }
test = { path = "test" }
svsm = { path = "kernel" }
elf = { path = "elf" }
Expand Down Expand Up @@ -127,6 +129,7 @@ missing_debug_implementations = { level = "deny", priority = 50 }
single_use_lifetimes = { level = "warn", priority = 125 }
trivial-numeric-casts = { level = "deny", priority = 10 }
unsafe_op_in_unsafe_fn = { level = "deny", priority = 2 }
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(verus_only)'] }

[workspace.lints.clippy]
await_holding_lock = "warn"
Expand Down
4 changes: 3 additions & 1 deletion kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ doctest = true
bootdefs.workspace = true
bootimg.workspace = true
cpuarch.workspace = true
paging.workspace = true

libaproxy = { workspace = true, optional = true }
elf.workspace = true
syscall.workspace = true
Expand Down Expand Up @@ -74,7 +76,7 @@ enable-gdb = ["dep:gdbstub", "dep:gdbstub_arch"]
vtpm = ["dep:libtcgtpm"]
nosmep = []
nosmap = []
verus_all = ["verus_builtin", "verus_builtin_macros", "vstd", "verify_proof/verus", "verify_external/verus", "verus_stub/disable"]
verus_all = ["verus_builtin", "verus_builtin_macros", "vstd", "verify_proof/verus", "verify_external/verus", "verus_stub/disable", "paging/verus"]
verus = ["verus_all", "verify_proof/noverify", "verify_external/noverify"]
noverify = []
virtio-drivers = ["dep:virtio-drivers"]
Expand Down
9 changes: 9 additions & 0 deletions kernel/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ use crate::virtio::VirtioError;
#[cfg(feature = "vsock")]
use crate::vsock::VsockError;
use elf::ElfError;
use paging::traits::PagingError;
use syscall::SysCallError;

/// Errors related to I/O operations.
Expand Down Expand Up @@ -160,6 +161,8 @@ pub enum SvsmError {
TeeAttestation(AttestationError),
/// Errors related to ImmutAfterInitCell
ImmutAfterInit(ImmutAfterInitError),
/// Errors from the paging crate
Paging(PagingError),
/// Errors related to vsock.
#[cfg(feature = "vsock")]
Vsock(VsockError),
Expand All @@ -179,6 +182,12 @@ impl From<ElfError> for SvsmError {
}
}

impl From<PagingError> for SvsmError {
fn from(err: PagingError) -> Self {
Self::Paging(err)
}
}

impl From<ApicError> for SvsmError {
fn from(err: ApicError) -> Self {
Self::Apic(err)
Expand Down
2 changes: 1 addition & 1 deletion kernel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#![cfg_attr(verus_keep_ghost, feature(proc_macro_hygiene))]

pub mod acpi;
pub mod address;
pub use paging::address;
#[cfg(feature = "attest")]
pub mod attest;
#[cfg(feature = "block")]
Expand Down
Loading