diff --git a/Cargo.lock b/Cargo.lock index eb3e01ca4..d4801ba57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,13 +1,13 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "acpi_tables" version = "0.1.0" -source = "git+https://github.com/rust-vmm/acpi_tables?branch=main#e268627630839bd22f1c13e7e81ec70c7e9b73d6" +source = "git+https://github.com/rust-vmm/acpi_tables?branch=main#e08a3f0b0a59b98859dbf59f5aa7fd4d2eb4018a" dependencies = [ - "zerocopy 0.7.35", + "zerocopy 0.8.24", ] [[package]] @@ -1264,7 +1264,7 @@ dependencies = [ "serde", "serde_derive", "vmm-sys-util", - "zerocopy 0.8.8", + "zerocopy 0.8.24", ] [[package]] @@ -2521,7 +2521,7 @@ dependencies = [ "vm-virtio", "vmm-sys-util", "zbus", - "zerocopy 0.7.35", + "zerocopy 0.8.24", ] [[package]] @@ -2886,11 +2886,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.8" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a4e33e6dce36f2adba29746927f8e848ba70989fdb61c772773bbdda8b5d6a7" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.8", + "zerocopy-derive 0.8.24", ] [[package]] @@ -2906,9 +2906,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.8" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd137b4cc21bde6ecce3bbbb3350130872cda0be2c6888874279ea76e17d4c1" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index 154896956..8e17a203a 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -5,9 +5,9 @@ version = 4 [[package]] name = "acpi_tables" version = "0.1.0" -source = "git+https://github.com/rust-vmm/acpi_tables?branch=main#849d5950196f66dd10f2b2606d8fe8c7cb39ec24" +source = "git+https://github.com/rust-vmm/acpi_tables?branch=main#e08a3f0b0a59b98859dbf59f5aa7fd4d2eb4018a" dependencies = [ - "zerocopy 0.7.35", + "zerocopy 0.8.24", ] [[package]] @@ -463,6 +463,7 @@ dependencies = [ "log", "mshv-bindings", "serde", + "serde_json", "serde_with", "thiserror 2.0.9", "vfio-ioctls", @@ -639,7 +640,7 @@ dependencies = [ "serde", "serde_derive", "vmm-sys-util", - "zerocopy 0.8.14", + "zerocopy 0.8.24", ] [[package]] @@ -788,7 +789,7 @@ checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha", "rand_core", - "zerocopy 0.8.14", + "zerocopy 0.8.24", ] [[package]] @@ -1294,7 +1295,7 @@ dependencies = [ "vm-migration", "vm-virtio", "vmm-sys-util", - "zerocopy 0.7.35", + "zerocopy 0.8.24", ] [[package]] @@ -1504,11 +1505,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.14" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.14", + "zerocopy-derive 0.8.24", ] [[package]] @@ -1524,9 +1525,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.14" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", diff --git a/vmm/Cargo.toml b/vmm/Cargo.toml index fc3fcfad9..34c7537a6 100644 --- a/vmm/Cargo.toml +++ b/vmm/Cargo.toml @@ -84,4 +84,4 @@ vm-migration = { path = "../vm-migration" } vm-virtio = { path = "../vm-virtio" } vmm-sys-util = { workspace = true, features = ["with-serde"] } zbus = { version = "4.4.0", optional = true } -zerocopy = { version = "0.7.35", features = ["alloc", "derive"] } +zerocopy = { version = "0.8.24", features = ["alloc", "derive"] } diff --git a/vmm/src/acpi.rs b/vmm/src/acpi.rs index ac4bc60ab..d45f6a719 100644 --- a/vmm/src/acpi.rs +++ b/vmm/src/acpi.rs @@ -19,7 +19,7 @@ use bitflags::bitflags; use pci::PciBdf; use tracer::trace_scoped; use vm_memory::{Address, Bytes, GuestAddress, GuestMemoryRegion}; -use zerocopy::AsBytes; +use zerocopy::{FromBytes, Immutable, IntoBytes}; use crate::cpu::CpuManager; use crate::device_manager::DeviceManager; @@ -45,7 +45,7 @@ pub const ACPI_APIC_GENERIC_TRANSLATOR: u8 = 15; #[allow(dead_code)] #[repr(C, packed)] -#[derive(Default, AsBytes)] +#[derive(Default, IntoBytes, Immutable, FromBytes)] struct PciRangeEntry { pub base_address: u64, pub segment: u16, @@ -56,7 +56,7 @@ struct PciRangeEntry { #[allow(dead_code)] #[repr(C, packed)] -#[derive(Default, AsBytes)] +#[derive(Default, IntoBytes, Immutable, FromBytes)] struct MemoryAffinity { pub type_: u8, pub length: u8, @@ -73,7 +73,7 @@ struct MemoryAffinity { #[allow(dead_code)] #[repr(C, packed)] -#[derive(Default, AsBytes)] +#[derive(Default, IntoBytes, Immutable, FromBytes)] struct ProcessorLocalX2ApicAffinity { pub type_: u8, pub length: u8, @@ -87,7 +87,7 @@ struct ProcessorLocalX2ApicAffinity { #[allow(dead_code)] #[repr(C, packed)] -#[derive(Default, AsBytes)] +#[derive(Default, IntoBytes, Immutable, FromBytes)] struct ProcessorGiccAffinity { pub type_: u8, pub length: u8, @@ -147,7 +147,7 @@ impl MemoryAffinity { #[allow(dead_code)] #[repr(C, packed)] -#[derive(Default, AsBytes)] +#[derive(Default, IntoBytes, Immutable, FromBytes)] struct ViotVirtioPciNode { pub type_: u8, _reserved: u8, @@ -159,7 +159,7 @@ struct ViotVirtioPciNode { #[allow(dead_code)] #[repr(C, packed)] -#[derive(Default, AsBytes)] +#[derive(Default, IntoBytes, Immutable, FromBytes)] struct ViotPciRangeNode { pub type_: u8, _reserved: u8, diff --git a/vmm/src/cpu.rs b/vmm/src/cpu.rs index 20e50d8c7..3fd3cdfbc 100644 --- a/vmm/src/cpu.rs +++ b/vmm/src/cpu.rs @@ -72,7 +72,7 @@ use vm_migration::{ }; use vmm_sys_util::eventfd::EventFd; use vmm_sys_util::signal::{register_signal_handler, SIGRTMIN}; -use zerocopy::AsBytes; +use zerocopy::{FromBytes, Immutable, IntoBytes}; #[cfg(all(target_arch = "x86_64", feature = "guest_debug"))] use crate::coredump::{ @@ -207,7 +207,7 @@ pub type Result = result::Result; #[cfg(target_arch = "x86_64")] #[allow(dead_code)] #[repr(C, packed)] -#[derive(AsBytes)] +#[derive(IntoBytes, Immutable, FromBytes)] struct LocalX2Apic { pub r#type: u8, pub length: u8, @@ -219,7 +219,7 @@ struct LocalX2Apic { #[allow(dead_code)] #[repr(C, packed)] -#[derive(Default, AsBytes)] +#[derive(Default, IntoBytes, Immutable, FromBytes)] struct Ioapic { pub r#type: u8, pub length: u8, @@ -232,7 +232,7 @@ struct Ioapic { #[cfg(target_arch = "aarch64")] #[allow(dead_code)] #[repr(C, packed)] -#[derive(AsBytes)] +#[derive(IntoBytes, Immutable, FromBytes)] struct GicC { pub r#type: u8, pub length: u8, @@ -257,7 +257,7 @@ struct GicC { #[cfg(target_arch = "aarch64")] #[allow(dead_code)] #[repr(C, packed)] -#[derive(AsBytes)] +#[derive(IntoBytes, Immutable, FromBytes)] struct GicD { pub r#type: u8, pub length: u8, @@ -272,7 +272,7 @@ struct GicD { #[cfg(target_arch = "aarch64")] #[allow(dead_code)] #[repr(C, packed)] -#[derive(AsBytes)] +#[derive(IntoBytes, Immutable, FromBytes)] struct GicR { pub r#type: u8, pub length: u8, @@ -284,7 +284,7 @@ struct GicR { #[cfg(target_arch = "aarch64")] #[allow(dead_code)] #[repr(C, packed)] -#[derive(AsBytes)] +#[derive(IntoBytes, Immutable, FromBytes)] struct GicIts { pub r#type: u8, pub length: u8, @@ -297,7 +297,7 @@ struct GicIts { #[cfg(target_arch = "aarch64")] #[allow(dead_code)] #[repr(C, packed)] -#[derive(AsBytes)] +#[derive(IntoBytes, Immutable, FromBytes)] struct ProcessorHierarchyNode { pub r#type: u8, pub length: u8, @@ -310,7 +310,7 @@ struct ProcessorHierarchyNode { #[allow(dead_code)] #[repr(C, packed)] -#[derive(Default, AsBytes)] +#[derive(Default, IntoBytes, Immutable, FromBytes)] struct InterruptSourceOverride { pub r#type: u8, pub length: u8, diff --git a/vmm/src/igvm/igvm_loader.rs b/vmm/src/igvm/igvm_loader.rs index 16f4faaa6..46ccfa7bd 100644 --- a/vmm/src/igvm/igvm_loader.rs +++ b/vmm/src/igvm/igvm_loader.rs @@ -17,7 +17,7 @@ use igvm_defs::{ use igvm_defs::{MemoryMapEntryType, IGVM_VHS_MEMORY_MAP_ENTRY}; use mshv_bindings::*; use thiserror::Error; -use zerocopy::AsBytes; +use zerocopy::IntoBytes; use crate::cpu::CpuManager; use crate::igvm::loader::Loader; diff --git a/vmm/src/igvm/mod.rs b/vmm/src/igvm/mod.rs index cc10240ae..06686b7a0 100644 --- a/vmm/src/igvm/mod.rs +++ b/vmm/src/igvm/mod.rs @@ -29,7 +29,7 @@ pub mod igvm_loader; mod loader; use igvm::snp_defs::SevVmsa; use igvm_defs::IGVM_VHS_SNP_ID_BLOCK; -use zerocopy::FromZeroes; +use zerocopy::FromZeros; #[derive(Debug, Clone)] pub struct IgvmLoadedInfo {