Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This file holds the UEFI build and evaluate instructions for RiscV Virt machine including a S-Mode EDK2 firmware and a StandaloneMm firmware which can be taken as a payload of the OpenSBI and run in a domain isolated by using the PMP/sPMP (re-used some Penglai code and put to OpenSBI).

We added MM service group in the RPMI spec https://docs.googlegithub.com/document/d/199ar3Ddd-FlzP1FR3HOkbBf1BNvLUPvJriscv-non-isa/riscv-rpmi, and evaluted the StandaloneMmPkg proejct based on the RPMI PoC mentioned here https://lists.riscv.org/g/tech-prsrpmi/message/59390.

How to build (Linux Environment)

...

Create a directory that would hold source code of the components.

Manually build

Compile QEMU

...

Compile UEFI and StandaloneMM

```
cd $WORKDIR
git clone https://github.com/tianocoreyli147/edk2-staging.git -b RiscV64StandaloneMmdev-standalonemm-mpxy-v3 edk2-staging
cd edk2-staging
git submodule update --init --recursive --depth=1
. edksetup.sh
make -C BaseTools
export GCC5_RISCV64_PREFIX=/usr/bin/riscv64-linux-gnu-
build -a RISCV64 -t GCC5 -p OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc -b DEBUG -DSECURE_BOOT_ENABLE=TRUE
build -a RISCV64 -t GCC5 -p OvmfPkg/RiscVVirt/RiscVVirtQemuStandaloneMm.dsc -b DEBUG -D FW_BASE_ADDRESS=0x80C00000
cp Build/RiscVVirtQemu/DEBUG_GCC5/FV/RISCV_VIRT_CODE.fd $WORKDIR
cp Build/RiscVVirtQemu/DEBUG_GCC5/FV/RISCV_VIRT_VARS.fd $WORKDIR
cp Build/RiscVVirtQemuStandaloneMm/DEBUG_GCC5/FV/STANDALONE_MM.fd $WORKDIR
```

Compile OpenSBI

```
cd $WORKDIR
git clone https://github.com/Penglai-Enclaveyli147/opensbi.git -b dev-standalonemm-rpmimpxy-v3
cd opensbi
CROSS_COMPILE=riscv64-linux-gnu- make FW_PIC=n PLATFORM=generic FW_TEXT_START=0x80000000
cp build/platform/generic/firmware/fw_dynamic.elf $WORKDIR
```

...

OpenSBI Domain and RPMI SBI Call

Image RemovedImage Added



 

Edit the Device Tree

Download this qemu-virt.dts manually and copy to the $WORKDIR, then generate the new dtb file, (ignore the interrupts_extended_property warnings)

...