From 40b8caf8c07b50a98d94ed68b692ccbc467e6cef Mon Sep 17 00:00:00 2001 From: Tyler Fanelli Date: Tue, 15 Oct 2024 17:43:16 -0400 Subject: [PATCH] launch: Hide SEV-only functions behind sev flag Signed-off-by: Tyler Fanelli --- src/launch/linux/ioctl.rs | 1 + src/launch/linux/shared.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/launch/linux/ioctl.rs b/src/launch/linux/ioctl.rs index bf030f5e..82766e88 100644 --- a/src/launch/linux/ioctl.rs +++ b/src/launch/linux/ioctl.rs @@ -237,6 +237,7 @@ pub struct Command<'a, T: Id> { impl<'a, T: Id> Command<'a, T> { /// create the command from a mutable subcommand + #[cfg(feature = "sev")] pub fn from_mut(sev: &'a impl AsRawFd, subcmd: &'a mut T) -> Self { Self { code: T::ID, diff --git a/src/launch/linux/shared.rs b/src/launch/linux/shared.rs index 31cc6b73..6cf511c2 100644 --- a/src/launch/linux/shared.rs +++ b/src/launch/linux/shared.rs @@ -22,6 +22,7 @@ pub struct Init2 { impl Init2 { /// Default INIT2 values for SEV + #[cfg(feature = "sev")] pub fn init_default_sev() -> Self { Self { vmsa_features: 0, @@ -33,6 +34,7 @@ impl Init2 { } /// Default INIT2 values for SEV-ES + #[cfg(feature = "sev")] pub fn init_default_es() -> Self { Self { vmsa_features: 0x1,