From e61ee6bcac5de24bfb3bf839c9c2fafa12a9c9f4 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 3 Feb 2021 10:02:18 +0000 Subject: [PATCH] tdx: Add "tdx" feature with an empty module inside arch to implement Add the skeleton of the "tdx" feature with a module ready inside the arch crate to store implementation details. TEST=cargo build --features="tdx" Signed-off-by: Rob Bradford --- Cargo.toml | 1 + arch/Cargo.toml | 1 + arch/src/x86_64/mod.rs | 2 ++ arch/src/x86_64/tdx/mod.rs | 4 ++++ vmm/Cargo.toml | 1 + 5 files changed, 9 insertions(+) create mode 100644 arch/src/x86_64/tdx/mod.rs diff --git a/Cargo.toml b/Cargo.toml index 1fd111ca2..1d97bdc81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,6 +56,7 @@ fwdebug = ["vmm/fwdebug"] kvm = ["vmm/kvm"] mshv = ["vmm/mshv"] io_uring = ["vmm/io_uring"] +tdx = ["vmm/tdx"] # Integration tests require a special environment to run in integration_tests = [] diff --git a/arch/Cargo.toml b/arch/Cargo.toml index a400554fe..8c2a84e3a 100644 --- a/arch/Cargo.toml +++ b/arch/Cargo.toml @@ -6,6 +6,7 @@ authors = ["The Chromium OS Authors"] [features] default = [] acpi = ["acpi_tables"] +tdx = [] [dependencies] acpi_tables = { path = "../acpi_tables", optional = true } diff --git a/arch/src/x86_64/mod.rs b/arch/src/x86_64/mod.rs index b4487fa01..e0e7dfe67 100644 --- a/arch/src/x86_64/mod.rs +++ b/arch/src/x86_64/mod.rs @@ -25,6 +25,8 @@ use vm_memory::{ }; mod smbios; use std::arch::x86_64; +#[cfg(feature = "tdx")] +pub mod tdx; #[derive(Debug, Copy, Clone)] pub enum BootProtocol { diff --git a/arch/src/x86_64/tdx/mod.rs b/arch/src/x86_64/tdx/mod.rs new file mode 100644 index 000000000..77674762c --- /dev/null +++ b/arch/src/x86_64/tdx/mod.rs @@ -0,0 +1,4 @@ +// Copyright © 2021 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + diff --git a/vmm/Cargo.toml b/vmm/Cargo.toml index 14332f80f..a4f24348c 100644 --- a/vmm/Cargo.toml +++ b/vmm/Cargo.toml @@ -12,6 +12,7 @@ fwdebug = ["devices/fwdebug"] kvm = ["hypervisor/kvm"] mshv = ["hypervisor/mshv"] io_uring = ["virtio-devices/io_uring"] +tdx = ["arch/tdx"] [dependencies] acpi_tables = { path = "../acpi_tables", optional = true }