Skip to content

Commit

Permalink
mps: update instructions for running tests under pKVM
Browse files Browse the repository at this point in the history
  • Loading branch information
spernsteiner committed Jun 1, 2024
1 parent 1a97da3 commit 74585e4
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions components/mission_protection_system/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,20 @@ that is running under a guest VM managed by the OpenSUT `vm_runner`.
First, cross-compile MPS for aarch64 in the appropriate configuration:

```sh
# In the mission_protection_system/src/ directory:
make clean
make \
CC=aarch64-linux-gnu-g++ \
CXX=aarch64-linux-gnu-g++ \
SENSORS=NotSimulated \
SELF_TEST=Disabled
# In the mission_protection_system/ directory:
./build_aarch64.sh
```

This will produce an aarch64 `rts` binary. On Debian, the necessary aarch64
toolchain can be installed from the `g++-aarch64-linux-gnu` package.
This will produce an aarch64 `rts.no_self_test.aarch64` binary. On Debian, the
necessary aarch64 toolchain can be installed from the `g++-aarch64-linux-gnu`
package.

Then, in the `vm_runner` directory, prepare host and guest application images
for running MPS:

```sh
# In the vm_runner/ directory:
bash tests/build_mps_image.sh
bash tests/mps/build_image.sh
```

This copies the aarch64 `rts` binary produced above into the images.
Expand All @@ -107,7 +103,7 @@ Start the VMs and MPS by running:

```sh
# In the vm_runner/ directory:
cargo run -- tests/hello_mps_nested.toml
cargo run -- tests/mps/base_nested.toml
```

This will start a host VM, a guest VM, and MPS inside the guest VM. It will
Expand All @@ -127,8 +123,8 @@ socat - unix:./serial.socket
```

This should display the usual MPS status screen and accept commands as normal.
Press ^C to disconnect (MPS will continue running). To restart MPS, enter the
`R` (reset) command.
Press ^C to disconnect (MPS will continue running). To restart MPS and reset
it to its initial state, enter the `R` (reset) command.

In this setup, `serial.socket` on the base system is connected to an emulated
UART in the host VM, which is forwarded to an emulated UART in the guest VM,
Expand Down

0 comments on commit 74585e4

Please sign in to comment.