From 65fd1aac81e37ab3c315d7a6f6a1cdf9c2b6a9ff Mon Sep 17 00:00:00 2001 From: Hsy-Intel Date: Sun, 22 Jun 2025 17:09:03 +0800 Subject: [PATCH] Sync CVM guest feature dependencies between kernel and virtio components --- Cargo.lock | 1 + kernel/Cargo.toml | 2 +- kernel/comps/virtio/Cargo.toml | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 507285071..bc7a0594c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,6 +316,7 @@ dependencies = [ "log", "ostd", "spin", + "tdx-guest", "typeflags-util", ] diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index cca82e4af..bd80da56b 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -72,7 +72,7 @@ riscv = { version = "0.11.1", features = ["s-mode"] } [features] all = ["cvm_guest"] -cvm_guest = ["dep:tdx-guest", "ostd/cvm_guest"] +cvm_guest = ["dep:tdx-guest", "ostd/cvm_guest", "aster-virtio/cvm_guest"] [lints] workspace = true diff --git a/kernel/comps/virtio/Cargo.toml b/kernel/comps/virtio/Cargo.toml index a610949fb..21f76c7a5 100644 --- a/kernel/comps/virtio/Cargo.toml +++ b/kernel/comps/virtio/Cargo.toml @@ -24,9 +24,12 @@ component = { path = "../../libs/comp-sys/component" } log = "0.4" int-to-c-enum = { path = "../../libs/int-to-c-enum" } +[target.x86_64-unknown-none.dependencies] +tdx-guest = { version = "0.2.1", optional = true } + [features] all = ["cvm_guest"] -cvm_guest = ["ostd/cvm_guest"] +cvm_guest = ["dep:tdx-guest", "ostd/cvm_guest"] [lints] workspace = true