From dedcd8f0b52d1655ae2fa783b1ee9552b84bce05 Mon Sep 17 00:00:00 2001 From: Jiaqi Gao Date: Wed, 11 Oct 2023 09:16:57 -0400 Subject: [PATCH] td-shim: init event log memory with `0xff` Align with `EDK2` implementation, to help OS to find the last event log entry. Signed-off-by: Jiaqi Gao --- td-shim/src/bin/td-shim/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/td-shim/src/bin/td-shim/main.rs b/td-shim/src/bin/td-shim/main.rs index 366af6c4..33784106 100644 --- a/td-shim/src/bin/td-shim/main.rs +++ b/td-shim/src/bin/td-shim/main.rs @@ -127,6 +127,8 @@ pub extern "win64" fn _start( // Set up the TD event log buffer. // Safe because it's used to initialize the EventLog subsystem which ensures safety. let event_log_buf = mem.get_dynamic_mem_slice_mut(memslice::SliceType::EventLog); + // Initialize event log memory with 0xff which help OS to know the last entry. + event_log_buf.fill(0xff); let mut td_event_log = CcEventLogWriter::new(event_log_buf, Box::new(td::extend_rtmr)) .expect("Failed to create and initialize the event log");