islet-project / islet

An on-device confidential computing platform
Apache License 2.0
91 stars 16 forks source link

Integrate vcpu and rec #330

Closed zpzigi754 closed 3 months ago

zpzigi754 commented 3 months ago

This PR contains the refactoring commits related to the earlier discussion (https://github.com/islet-project/islet/discussions/230). VCPU and REC (Realm Execution Context) have almost the same purpose. It aims to keep only REC which is defined by spec.

Summary of changes

-pub struct VCPU {
-    pub context: Context,
-    pub state: State,
-    pub pcpu: Option<usize>,
-    me: Weak<Mutex<Self>>,
-}

+[repr(C)]
pub struct Rec<'a> {
+   pub context: Context,
    attest_state: RmmRecAttestState,
...
-   state: RecState,
+   state: State,
    ripas: Ripas,
    vtcr: u64,
    host_call_pending: bool,
}

Note