From f6d99d9a9b07507eecd5a1bd23389efb3742fc22 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Fri, 26 Apr 2024 23:16:01 +0000 Subject: [PATCH] build: use released version of the IGVM crates No functional change. While at it, consolidate some of the IGVM related import directives. Signed-off-by: Wei Liu --- Cargo.lock | 10 ++++++---- hypervisor/Cargo.toml | 6 +++--- vmm/Cargo.toml | 6 +++--- vmm/src/igvm/igvm_loader.rs | 23 ++++++++--------------- vmm/src/igvm/mod.rs | 2 +- 5 files changed, 21 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18d10d781..d5feb7052 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1071,8 +1071,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "igvm" -version = "0.1.9" -source = "git+https://github.com/microsoft/igvm?branch=main#494aac2318df4111a2737d360ea46f74f5350223" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dac310e8c44854718e087821efe5d30ed18f3f864b3926b777ef70aadbb9834d" dependencies = [ "bitfield-struct", "crc32fast", @@ -1087,8 +1088,9 @@ dependencies = [ [[package]] name = "igvm_defs" -version = "0.1.9" -source = "git+https://github.com/microsoft/igvm?branch=main#494aac2318df4111a2737d360ea46f74f5350223" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a57e85ae9109a6281a1fc279456f830237a94a65873a331ad858814b1a09b2b" dependencies = [ "bitfield-struct", "open-enum", diff --git a/hypervisor/Cargo.toml b/hypervisor/Cargo.toml index cef75c451..248189304 100644 --- a/hypervisor/Cargo.toml +++ b/hypervisor/Cargo.toml @@ -8,14 +8,14 @@ license = "Apache-2.0 OR BSD-3-Clause" [features] kvm = ["kvm-ioctls", "kvm-bindings", "vfio-ioctls/kvm"] mshv = ["mshv-ioctls", "mshv-bindings", "vfio-ioctls/mshv", "iced-x86"] -sev_snp = ["igvm_parser", "igvm_defs"] +sev_snp = ["igvm", "igvm_defs"] tdx = [] [dependencies] anyhow = "1.0.81" byteorder = "1.5.0" -igvm_defs = { git = "https://github.com/microsoft/igvm", branch = "main", package = "igvm_defs", optional = true } -igvm_parser = { git = "https://github.com/microsoft/igvm", branch = "main", package = "igvm", optional = true } +igvm = { version = "0.2.0", optional = true } +igvm_defs = { version = "0.2.0", optional = true } libc = "0.2.153" log = "0.4.21" kvm-bindings = { version = "0.8.1", optional = true, features = ["serde"] } diff --git a/vmm/Cargo.toml b/vmm/Cargo.toml index bac30fbba..63525a18f 100644 --- a/vmm/Cargo.toml +++ b/vmm/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" default = [] dbus_api = ["blocking", "futures", "zbus"] guest_debug = ["kvm", "gdbstub", "gdbstub_arch"] -igvm = ["hex", "igvm_parser", "igvm_defs", "mshv-bindings", "range_map_vec"] +igvm = ["hex", "dep:igvm", "igvm_defs", "mshv-bindings", "range_map_vec"] io_uring = ["block/io_uring"] kvm = ["hypervisor/kvm", "vfio-ioctls/kvm", "vm-device/kvm", "pci/kvm"] mshv = ["hypervisor/mshv", "vfio-ioctls/mshv", "vm-device/mshv", "pci/mshv"] @@ -35,8 +35,8 @@ gdbstub = { version = "0.7.1", optional = true } gdbstub_arch = { version = "0.3.0", optional = true } hex = { version = "0.4.3", optional = true } hypervisor = { path = "../hypervisor" } -igvm_defs = { git = "https://github.com/microsoft/igvm", branch = "main", package = "igvm_defs", optional = true } -igvm_parser = { git = "https://github.com/microsoft/igvm", branch = "main", package = "igvm", optional = true } +igvm = { version = "0.2.0", optional = true } +igvm_defs = { version = "0.2.0", optional = true } libc = "0.2.153" linux-loader = { version = "0.11.0", features = ["elf", "bzimage", "pe"] } log = "0.4.21" diff --git a/vmm/src/igvm/igvm_loader.rs b/vmm/src/igvm/igvm_loader.rs index a83126b38..90d3aabbf 100644 --- a/vmm/src/igvm/igvm_loader.rs +++ b/vmm/src/igvm/igvm_loader.rs @@ -5,21 +5,14 @@ use crate::cpu::CpuManager; use zerocopy::AsBytes; -use crate::igvm::loader::Loader; -use crate::igvm::IgvmLoadedInfo; -use crate::igvm::{BootPageAcceptance, StartupMemoryType, HV_PAGE_SIZE}; +use crate::igvm::{ + loader::Loader, BootPageAcceptance, IgvmLoadedInfo, StartupMemoryType, HV_PAGE_SIZE, +}; use crate::memory_manager::MemoryManager; -use igvm_defs::IgvmPageDataType; -use igvm_defs::IgvmPlatformType; -use igvm_parser::IgvmDirectiveHeader; -use igvm_parser::IgvmFile; -use igvm_parser::IgvmPlatformHeader; -use igvm_parser::IsolationType; - -use igvm_defs::IGVM_VHS_PARAMETER; -use igvm_defs::IGVM_VHS_PARAMETER_INSERT; - -use igvm_parser::snp_defs::SevVmsa; +use igvm::{snp_defs::SevVmsa, IgvmDirectiveHeader, IgvmFile, IgvmPlatformHeader, IsolationType}; +use igvm_defs::{ + IgvmPageDataType, IgvmPlatformType, IGVM_VHS_PARAMETER, IGVM_VHS_PARAMETER_INSERT, +}; use mshv_bindings::*; use std::collections::HashMap; use std::ffi::CString; @@ -42,7 +35,7 @@ pub enum Error { #[error("failed to read igvm file")] Igvm(#[source] std::io::Error), #[error("invalid igvm file")] - InvalidIgvmFile(#[source] igvm_parser::Error), + InvalidIgvmFile(#[source] igvm::Error), #[error("invalid guest memory map")] InvalidGuestMemmap(#[source] arch::Error), #[error("loader error")] diff --git a/vmm/src/igvm/mod.rs b/vmm/src/igvm/mod.rs index 1721b47b7..cc10240ae 100644 --- a/vmm/src/igvm/mod.rs +++ b/vmm/src/igvm/mod.rs @@ -27,8 +27,8 @@ pub mod igvm_loader; mod loader; +use igvm::snp_defs::SevVmsa; use igvm_defs::IGVM_VHS_SNP_ID_BLOCK; -use igvm_parser::snp_defs::SevVmsa; use zerocopy::FromZeroes; #[derive(Debug, Clone)]