Skip to content

Commit

Permalink
stage2: copy svsm to stage2
Browse files Browse the repository at this point in the history
This commit copies all files from the svsm directory a new stage2
directory without making any additional changes to any of the files.

Signed-off-by: Tom Dohrmann <[email protected]>
  • Loading branch information
Freax13 committed Oct 31, 2024
1 parent bb6e922 commit 9a246b1
Show file tree
Hide file tree
Showing 131 changed files with 32,922 additions and 0 deletions.
53 changes: 53 additions & 0 deletions stage2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[package]
name = "svsm"
version = "0.1.0"
edition = "2021"
rust-version = "1.82.0"

[[bin]]
name = "stage2"
path = "src/stage2.rs"
test = false

[[bin]]
name = "svsm"
path = "src/svsm.rs"
test = false

[lib]
test = true
doctest = true

[dependencies]
bootlib.workspace = true
cpuarch.workspace = true
elf.workspace = true
syscall.workspace = true

aes-gcm = { workspace = true, features = ["aes", "alloc"] }
bitfield-struct.workspace = true
bitflags.workspace = true
gdbstub = { workspace = true, optional = true }
gdbstub_arch = { workspace = true, optional = true }
igvm_defs = { workspace = true, features = ["unstable"] }
intrusive-collections.workspace = true
log = { workspace = true, features = ["max_level_info", "release_max_level_info"] }
packit.workspace = true
tdx-tdcall.workspace = true
libmstpm = { workspace = true, optional = true }
zerocopy.workspace = true

[target."x86_64-unknown-none".dev-dependencies]
test.workspace = true

[features]
default = []
enable-gdb = ["dep:gdbstub", "dep:gdbstub_arch"]
mstpm = ["dep:libmstpm"]
nosmep = []
nosmap = []

[dev-dependencies]

[lints]
workspace = true
38 changes: 38 additions & 0 deletions stage2/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
//
// Copyright (c) 2022-2023 SUSE LLC
//
// Author: Joerg Roedel <[email protected]>

fn main() {
// Extra cfgs
println!("cargo::rustc-check-cfg=cfg(fuzzing)");
println!("cargo::rustc-check-cfg=cfg(test_in_svsm)");

// Stage 2
println!("cargo:rustc-link-arg-bin=stage2=-nostdlib");
println!("cargo:rustc-link-arg-bin=stage2=--build-id=none");
println!("cargo:rustc-link-arg-bin=stage2=-Tkernel/src/stage2.lds");
println!("cargo:rustc-link-arg-bin=stage2=-no-pie");

// SVSM 2
println!("cargo:rustc-link-arg-bin=svsm=-nostdlib");
println!("cargo:rustc-link-arg-bin=svsm=--build-id=none");
println!("cargo:rustc-link-arg-bin=svsm=--no-relax");
println!("cargo:rustc-link-arg-bin=svsm=-Tkernel/src/svsm.lds");
println!("cargo:rustc-link-arg-bin=svsm=-no-pie");

// Extra linker args for tests.
println!("cargo:rerun-if-env-changed=LINK_TEST");
if std::env::var("LINK_TEST").is_ok() {
println!("cargo:rustc-cfg=test_in_svsm");
println!("cargo:rustc-link-arg=-nostdlib");
println!("cargo:rustc-link-arg=--build-id=none");
println!("cargo:rustc-link-arg=--no-relax");
println!("cargo:rustc-link-arg=-Tkernel/src/svsm.lds");
println!("cargo:rustc-link-arg=-no-pie");
}

println!("cargo:rerun-if-changed=kernel/src/stage2.lds");
println!("cargo:rerun-if-changed=kernel/src/svsm.lds");
}
7 changes: 7 additions & 0 deletions stage2/src/acpi/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
//
// Copyright (c) 2022-2023 SUSE LLC
//
// Author: Joerg Roedel <[email protected]>

pub mod tables;
Loading

0 comments on commit 9a246b1

Please sign in to comment.