Versions Compared

Key

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

Overview

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 or TEE.

Here we tested for the CoVE based TEE.

How to build (Linux Environment)

Obtaining source code

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

...

CoVE Project: https://github.com/rivosinc/salus.git 

Manually build

Compile QEMU

```
export WORKDIR=`pwd`

git clone https://github.com/rivosinc/qemu.git -b rivos/main
cd qemu

...

QEMU should be installed now in $WORKDIR

Compile UEFI and StandaloneMM for QEMU Virt

```
cd $WORKDIR
git clone https://github.com/tianocore/edk2-staging edk2 -b RiscV64StandaloneMm
cd edk2
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 -D FW_BASE_ADDRESS=0x80200000 -D SECURE_BOOT_ENABLE=TRUE -D MM_WITH_COVE_ENABLE=TRUE
build -a RISCV64 -t GCC5 -p OvmfPkg/RiscVVirt/RiscVVirtQemuStandaloneMm.dsc -b DEBUG -D FW_BASE_ADDRESS=0x80200000 -D MM_WITH_COVE_ENABLE=TRUE
```

...

```
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 Salus

```
cd $WORKDIR
git clone https://github.com/rivosinc/salus.git
cd salus
git checkout 9e261f945036a7b39c3aeae98e3edbcc121ab598
cd salus
make salus
```

Run the UEFI and StandaloneMm firmware

Create a "run_edk2.sh" script as below content under salus/scripts folder

...

ln -s $WORKDIR/STANDALONE_MM.fd edk2_mmmake salus

./scripts/run_edk2.sh

```