Add tdx early init and ve handler functions

This commit is contained in:
Hsy-Intel
2023-08-28 11:30:19 +08:00
committed by Tate, Hongliang Tian
parent d7710207bb
commit 4f0df44b29
3 changed files with 166 additions and 1 deletions

View File

@ -40,6 +40,8 @@ pub use self::prelude::Result;
use alloc::vec::Vec;
use arch::irq::{IrqCallbackHandle, IrqLine};
use core::{mem, panic::PanicInfo};
#[cfg(feature = "intel_tdx")]
use tdx_guest::tdx_early_init;
use trapframe::TrapFrame;
static mut IRQ_CALLBACK_LIST: Vec<IrqCallbackHandle> = Vec::new();
@ -47,6 +49,13 @@ static mut IRQ_CALLBACK_LIST: Vec<IrqCallbackHandle> = Vec::new();
pub fn init() {
arch::before_all_init();
logger::init();
#[cfg(feature = "intel_tdx")]
let td_info = tdx_early_init().unwrap();
#[cfg(feature = "intel_tdx")]
println!(
"td gpaw: {}, td attributes: {:?}\nTDX guest is initialized",
td_info.gpaw, td_info.attributes
);
vm::heap_allocator::init();
boot::init();
vm::init();