Skip to content

Conversation

@cap2k4-rivos
Copy link
Owner

Description

This adds the Variable Service in RISC-V Management Mode.

How This Was Tested

Note: This branch is not complete, to test use this Branch.

cap2k4-rivos pushed a commit that referenced this pull request Sep 8, 2025
Implementation is based on
https://github.com/riscv-non-isa/riscv-rpmi/tree/main
and works in the following way:
1. MM initialization is successful -> call REQFWD_COMPLETE_CURRENT_MESSAGE
   to yield. (this API will change once we have properly defined the init
   API for MM)
2. NS domain calls MM_COMMUNICATE, OpenSBI performs context switch
   (if channel is not capable of SSE) -> MM resumes loop from
   REQFWD_COMPLETE_CURRENT_MESSAGE.
3. Calls REQFWD_RETRIEVE_CURRENT_MESSAGE.
4. MM handles the request contained in the message.
5. MM calls REQFWD_COMPLETE_CURRENT_MESSAGE.
6. OpenSBI switches to the non-secure domain (as there are no more
   messages in the queue && SSE is not supported)
7. Go to #2

Signed-off-by: Dhaval Sharma <[email protected]>
@cap2k4-rivos cap2k4-rivos force-pushed the dev/cap2k4/MMVariableService branch from fbe3e1a to a0bae81 Compare September 8, 2025 08:56
yli147 and others added 5 commits September 8, 2025 14:28
This VirtNorFlash module is required for StandaloneMm firmware.
This StandaloneMm implementation is mostly copied from
edk2-platforms/Platform/ARM/Drivers/NorFlashDxe

Signed-off-by: Yong Li <[email protected]>
The FTW (Fault Tolerant Write) protocol is called
when the variable reclaiming happens
Signed-off-by: Yong Li <[email protected]>
Add support for UEFI secure variable service using the standalone MM
framework on RiscV64. It moves the software handling of the UEFI
authenticated variable store into the standalone MM context, which
is a platform defined secure environment. For the OpenSBI based secure
montor implementaion, the secure variable storage is put at a specific
address in the flash0 block in Qemu virt machine. The Non-secure shared
memory between UEFI and standalone MM is allocated at 0xFFE00000.

The SECURE_BOOT_ENABLE is disabled as default, need add build
option-DSECURE_BOOT_ENABLE=TRUE to enable this feature.

Signed-off-by: Yong Li <[email protected]>
Signed-off-by: Dhaval Sharma <[email protected]>
@cap2k4-rivos cap2k4-rivos force-pushed the dev/cap2k4/MMVariableService branch from a0bae81 to 00543ca Compare September 8, 2025 08:59
cap2k4-rivos pushed a commit that referenced this pull request Sep 8, 2025
Implementation is based on
https://github.com/riscv-non-isa/riscv-rpmi/tree/main
and works in the following way:
1. MM initialization is successful -> call REQFWD_COMPLETE_CURRENT_MESSAGE
   to yield. (this API will change once we have properly defined the init
   API for MM)
2. NS domain calls MM_COMMUNICATE, OpenSBI performs context switch
   (if channel is not capable of SSE) -> MM resumes loop from
   REQFWD_COMPLETE_CURRENT_MESSAGE.
3. Calls REQFWD_RETRIEVE_CURRENT_MESSAGE.
4. MM handles the request contained in the message.
5. MM calls REQFWD_COMPLETE_CURRENT_MESSAGE.
6. OpenSBI switches to the non-secure domain (as there are no more
   messages in the queue && SSE is not supported)
7. Go to #2

Signed-off-by: Dhaval Sharma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants