Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 27 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 4 additions & 25 deletions deps/td-shim-AzCVMEmu/azcvm-extract-report/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deps/td-shim-AzCVMEmu/td-shim-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords = ["td-shim", "TDX", "intel", "azure", "emulation"]
[dependencies]
scroll = { version = "0.10", default-features = false, features = ["derive"] }
r-efi = "3.2.0"
zerocopy = { version = "0.7", features = ["derive"] }
zerocopy = { version = "=0.8.27", features = ["derive"] }

[features]
default = ["std"]
Expand Down
6 changes: 3 additions & 3 deletions deps/td-shim-AzCVMEmu/td-shim-interface/src/acpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//! ACPI emulation for td-shim-interface-emu
//! Provides minimal ACPI types needed by migtd

use zerocopy::{AsBytes, FromBytes, FromZeroes};
use zerocopy::{FromBytes, Immutable, IntoBytes};

#[repr(C, packed)]
#[derive(Default, AsBytes, FromBytes, FromZeroes, Copy, Clone)]
#[derive(Default, IntoBytes, FromBytes, Immutable, Copy, Clone)]
pub struct GenericSdtHeader {
pub signature: [u8; 4],
pub length: u32,
Expand Down Expand Up @@ -44,7 +44,7 @@ impl GenericSdtHeader {
}

#[repr(C, packed)]
#[derive(Default, AsBytes, FromBytes, FromZeroes, Copy, Clone)]
#[derive(Default, IntoBytes, FromBytes, Immutable, Copy, Clone)]
pub struct Ccel {
pub header: GenericSdtHeader,
pub cc_type: u8,
Expand Down
2 changes: 1 addition & 1 deletion deps/td-shim-AzCVMEmu/td-shim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ std = []

[dependencies]
cc-measurement = { path = "../../td-shim/cc-measurement"}
zerocopy = { version = "0.7", features = ["derive"] }
zerocopy = { version = "=0.8.27", features = ["derive"] }
11 changes: 8 additions & 3 deletions deps/td-shim-AzCVMEmu/td-shim/src/event_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ fn populate_tcg_pcr_event_log() {

use cc_measurement::{TcgEfiSpecIdevent, TcgPcrEventHeader};
use core::mem::size_of;
use zerocopy::AsBytes;

// Create the initial TCG_EfiSpecIDEvent using the default implementation
let spec_id_event = TcgEfiSpecIdevent::default();
Expand All @@ -394,12 +393,18 @@ fn populate_tcg_pcr_event_log() {
let mut offset = 0;

// Write TcgPcrEventHeader
let pcr_header_bytes = pcr_header.as_bytes();
let pcr_header_bytes = slice::from_raw_parts(
&pcr_header as *const TcgPcrEventHeader as *const u8,
size_of::<TcgPcrEventHeader>(),
);
log.data[offset..offset + pcr_header_bytes.len()].copy_from_slice(pcr_header_bytes);
offset += pcr_header_bytes.len();

// Write TcgEfiSpecIdevent
let spec_id_bytes = spec_id_event.as_bytes();
let spec_id_bytes = slice::from_raw_parts(
&spec_id_event as *const TcgEfiSpecIdevent as *const u8,
size_of::<TcgEfiSpecIdevent>(),
);
log.data[offset..offset + spec_id_bytes.len()].copy_from_slice(spec_id_bytes);

// No need to track size - parsing logic will determine the written portion
Expand Down
2 changes: 1 addition & 1 deletion deps/td-shim-AzCVMEmu/tdx-tdcall/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ log = { version = "0.4", default-features = false }

# Azure CVM specific dependencies
az-tdx-vtpm = { version = "=0.8.0", git = "https://github.com/kinvolk/azure-cvm-tooling", package = "az-tdx-vtpm", default-features = false, features = ["attester"] }
zerocopy = { version = "0.7", features = ["derive"] }
zerocopy = { version = "0.8", features = ["derive"] }
Comment thread
jyao1 marked this conversation as resolved.

# For compatibility with original tdx-tdcall interface
bitflags = "2.11"
Expand Down
6 changes: 3 additions & 3 deletions deps/td-shim-AzCVMEmu/tdx-tdcall/src/logging_emu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::env;
use std::fs::{File, OpenOptions};
use std::io::{BufWriter, Write};
use std::sync::Mutex;
use zerocopy::{transmute_ref, AsBytes, FromBytes, FromZeroes};
use zerocopy::{transmute_ref, FromBytes, Immutable, IntoBytes};

const PAGE_SIZE: usize = 0x1000;
const LOG_ENTRY_HEADER_SIZE: usize = core::mem::size_of::<LogEntryHeader>();
Expand All @@ -21,7 +21,7 @@ pub const LOGAREA_SIGNATURE: [u8; 16] = [
];

#[repr(C, packed)]
#[derive(AsBytes, FromBytes, FromZeroes, Debug, Clone, Copy)]
#[derive(IntoBytes, FromBytes, Immutable, Debug, Clone, Copy)]
pub struct LogAreaBufferHeader {
pub signature: [u8; 16],
pub vcpuindex: u32,
Expand All @@ -31,7 +31,7 @@ pub struct LogAreaBufferHeader {
}

#[repr(C, packed)]
#[derive(AsBytes, FromBytes, FromZeroes, Debug, Clone, Copy)]
#[derive(IntoBytes, FromBytes, Immutable, Debug, Clone, Copy)]
pub struct LogEntryHeader {
pub log_entry_id: u64,
pub mig_request_id: u64,
Expand Down
2 changes: 1 addition & 1 deletion src/migtd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ virtio_serial = { path="../devices/virtio_serial", optional = true }
vmcall_raw = { path="../devices/vmcall_raw", optional = true }
x86 = "0.47.0"
x86_64 = { version = "0.14", default-features = false, features = ["instructions"] }
zerocopy = { version = "0.7", features = ["derive"] }
zerocopy = { version = "=0.8.27", features = ["derive"] }
bitfield-struct = "0.11"
raw-cpuid = "11.6.0"
sha2 = { version = "0.10.2", default-features = false, optional = true }
Expand Down
5 changes: 2 additions & 3 deletions src/migtd/src/event_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ use td_shim::event_log::{
};
use td_shim_interface::acpi::Ccel;
use tdx_tdcall::tdx;
use zerocopy::{AsBytes, FromBytes};

use zerocopy::{FromBytes, IntoBytes};
pub const EV_EVENT_TAG: u32 = 0x00000006;
pub const TEST_DISABLE_RA_AND_ACCEPT_ALL_EVENT: &[u8] = b"test_disable_ra_and_accept_all";

Expand Down Expand Up @@ -99,7 +98,7 @@ fn get_ccel() -> Option<&'static Ccel> {
return None;
}

let ccel = Ccel::read_from(&ccel[..size_of::<Ccel>()])?;
let ccel = Ccel::read_from_bytes(&ccel[..size_of::<Ccel>()]).ok()?;

Some(CCEL.call_once(|| ccel))
} else {
Expand Down
Loading
Loading