+---U-mode--+ +-----VS-mode-----+ +-VS-mode-+
| | | | | |
| | | +---VU-mode---+ | | |
| Salus | | | VMM(crosvm) | | | Guest |
| Delegated | | +-------------+ | | |
| Tasks | | | | |
| | | Host(linux) | | |
+-----------+ +-----------------+ +---------+
| | |
TBD syscall SBI (COVH-API) SBI(COVG-API)
| | |
+-------------HS-mode-----------------------+
| Salus |
+-------------------------------------------+
|
SBI
|
+----------M-mode---------------------------+
| Firmware(OpenSBI) |
+-------------------------------------------+
The entry point should take the following parameters:
The following booting are copied from ARM definition. There are always a specific requirements for RISC-V so the structure can't be the same between ARM and RISC-V.
The code should have separated header file for RISC-V
Type | Name | Note |
---|---|---|
UINT8 | Type | The type of booting info structure. |
UINT8 | Version | The version of booting info structure. |
UINT16 | Size | The size of booting info structure. |
UINT32 | Attr | The attributes of MM. 1: APTEE MM payload |
Type | Name | Note |
---|---|---|
UINT32 | ProcessorId | The unique processor ID. |
UINT32 | Package | The zezo-based physical package number. |
UINT32 | Core | The zezo-based physical core number. |
UINT32 | Flags | 1: This CPU is primary core provided boot service protocol (BSP). |
EFI_RISCV_MM_CPU_INFO
Type | Name | Note |
---|---|---|
EFI_PARAM_HEADER | Header | |
UINT64 | MmMemBase | The base address of memory assigned to MM. |
UINT64 | MmMemLimit | The limit address of memory assigned to MM. |
UINT64 | MmImageBase | The bass address of MM FD. |
UINT64 | MmStackBase | The stack base address. Note, MM will setup SP register with this value regardless it may be setup before entering entry point. |
UINT64 | MmHeapBase | The heap base address that will be used to allocate HOB memory. |
UINT64 | MmNsCommBufBase | The base address of shared buffer between MM and non secure world. It is set up as non confidential memory. |
UINT64 | MmSharedBufBase | The base address of shared buffer between MM and secure world. It is set up as confidential memory. But it should not be trusted by MM. |
UINT64 | MmImageSize | The size of MM FD. |
UINT64 | MmPcpuStackSize | The size of stack per CPU. |
UINT64 | MmHeapSize | The size of heap region. |
UINT64 | MmNsCommBufSize | The size of shared buffer between MM and non secure world. |
UINT64 | MmSharedBufSize | The size of shared buffer between MM and secure world. |
UINT64 | NumMmMemRegions | The number of memory regions that be registered with MM core. Minimum are 6 core regions: MemBase, ImageBase, StackBase, HeapBase, NsCommBufBase, SharedBufBase. Additional region can be added at the end of structure for a driver. |
UINT64 | NumCpus | The number of CPUs info that assigned to MM. |
EFI_RISCV_MM_CPU_INFO | CpuInfo[NumCpus] | The array of CPUs info. |
EFI_RISCV_MM_BOOT_INFO
Information will be communicated using MmNsCommBufBase and MmNsCommBufSize that passed from booting info.
The format of MmNsCommBufBase:
EFI_MMRAM_DESCRIPTION |
---|
EFI_MM_COMMUNICATE_HEADER |
PAYLOAD |
Both EFI_MMRAM_DESCRIPTION and EFI_MM_COMMUNICATE_HEADER are standard EDK2 communicate protocol as described:
EFI_MMRAM_DESCRIPTION | EFI_MM_COMMUNICATE_HEADER |
---|---|
/// | /// |
Pseudo code of delegated event loop.
Make sure MessageLength is zero While true
|
---|