Skip to content

Commit

Permalink
launch: Hide SEV-only functions behind sev flag
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Fanelli <[email protected]>
  • Loading branch information
tylerfanelli committed Oct 15, 2024
1 parent 2201cd4 commit 40b8caf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/launch/linux/ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/launch/linux/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 40b8caf

Please sign in to comment.