Skip to content
Draft
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
c2fb2f3
env/: Implement Docker environment
Oct 25, 2024
b9068aa
Dockerfile: add necessary deps
WiktorG351 Nov 27, 2024
97add76
env/build.sh: added
WiktorG351 Nov 27, 2024
ec83206
env/Dockerfile: reorder packages neatly
WiktorG351 Nov 27, 2024
3c7be81
deleted build script, readme update
WiktorG351 Dec 9, 2024
f15834b
Dockerfile: add qemu riscv deps and add build script for rpi4-ws demo
WiktorG351 Dec 9, 2024
f483cb0
remove tarballs, change debian version, update path
WiktorG351 Dec 12, 2024
4a8f583
fix export
WiktorG351 Dec 12, 2024
b9feed1
add working toolchain to dockerfile
WiktorG351 Dec 12, 2024
d250305
env/README.md: remove unnecessary docker create instruction
WiktorG351 Dec 12, 2024
1ea76ea
env/README.md: change ubuntu to debian
WiktorG351 Dec 12, 2024
4d98890
env/README.md: change adressing (no first person)
WiktorG351 Dec 12, 2024
ccf0366
env/Dockerfile: start interactive shell at /work/crosscon
tym2k1 Dec 12, 2024
159a43b
env/Dockerfile: use aarch64-*-gcc v11.2
tym2k1 Dec 13, 2024
23b5c03
env/Dockerfile: add ncurses
tym2k1 Dec 19, 2024
13ad520
env/*: copy the local repository instead of pulling a fresh one
tym2k1 Dec 19, 2024
ec3a6c6
env: README: fix building hypervisor artifacts
DaniilKl Dec 24, 2024
f68a0cc
env/README.md: standarize mountpoint path reference
tym2k1 Jan 27, 2025
349abf2
env/Dockerfile: fix path when running from repo rootdir
tym2k1 Jan 27, 2025
643745e
env/files/env.sh: remove
tym2k1 Jan 27, 2025
7047640
env/Dockerfile: add libteec2 package from trixie repository
tym2k1 Jan 27, 2025
c1febc1
env/Dockerfile: reduce image size by cleaning at the end
tym2k1 Jan 27, 2025
e910105
env/README.md: add instructions how to flash SD from inside container
tym2k1 Jan 28, 2025
0d34d64
Merge pull request #6 from 3mdeb/develop
DaniilKl Mar 5, 2025
22358b5
support/linux-aarch64.config: add missing CROSSCONHYP_SHMEM config
m-iwanicki Apr 8, 2025
cc66cb1
rpi4-ws/README.md: add '-f' to rm so it doesn't error & format text
m-iwanicki Apr 8, 2025
eece692
rpi4-ws: use SDCARD variable in scripts & cd to RPI4_WS dir before use
m-iwanicki Apr 8, 2025
eb79bf2
Merge pull request #8 from 3mdeb/add-shared-mem-conf
m-iwanicki Apr 14, 2025
e6c2fbc
rpi4-ws: Automate building demos
3mkusiak Apr 24, 2025
25a2830
rpi4-ws: Automate building demos pt.2
3mkusiak May 9, 2025
5898d5a
rpi4-ws: Automate building demos pt.3
3mkusiak May 9, 2025
fecaa4b
rpi4-ws: Automate building demos pt.4
3mkusiak May 9, 2025
5fbaada
env/build_rpi4.sh create missing optee dir
macpijan May 10, 2025
91bbc13
build_rpi4.sh: ingore error when creating bin dir
macpijan May 10, 2025
59bfa3c
env/hyp_build_and_copy.sh: accept DEV_PATH from environment
macpijan May 10, 2025
4c3f3b3
env/hyp_build_and_copy.sh: add sync before umounting
macpijan May 10, 2025
dee40e2
rpi4-ws: Build image
3mkusiak May 12, 2025
71236cd
rpi4-ws: Build image pt.2
3mkusiak May 13, 2025
26aa9d3
rpi4-ws: Build image pt.3
3mkusiak May 13, 2025
4a8b5b4
rpi4-ws: Build image pt.4
3mkusiak May 13, 2025
94b0b24
Merge pull request #11 from 3mdeb/crscn-rpi4ws-build
pietrushnic May 14, 2025
b58ab6c
rpi4-ws/configs/rpi4-single-vTEE/config.c: enable ethernet in REE in …
tym2k1 Jan 28, 2025
d506091
support/linux-aarch64.config: CONFIG_BCMGENET=m -> CONFIG_BCMGENET=y
tym2k1 Jan 28, 2025
18e9e78
CROSSCON-Hypervisor: use patched fork
tym2k1 Jan 28, 2025
ae1e7f2
go back to old submodule setup
WiktorG351 Feb 26, 2025
647dfd3
rpi4-ws/README.md: add internet-enabling command
WiktorG351 Feb 26, 2025
63e40a9
rpi4-ws: configs: rpi4-single-vTEE: delete interrupts 0 and 4 from Wifi
DaniilKl May 15, 2025
7ebfba6
Merge pull request #7 from 3mdeb/network_support
DaniilKl May 15, 2025
bf3e0e0
CROSSCON-Hypervisor: add interrupt 27 fix
DaniilKl May 22, 2025
db58da3
Merge pull request #12 from 3mdeb/fix-interrupt-27-hyp
DaniilKl May 22, 2025
64aad72
rpi4-ws: configs: rpi4-single-vTEE: eth has 2 interrupts not 4
DaniilKl May 22, 2025
0a76e85
Merge pull request #13 from 3mdeb/correct-interrupts
DaniilKl May 22, 2025
8f58f78
rpi4-ws & security-test: add security test and minimal 2 VM config
m-iwanicki Apr 10, 2025
9290757
CROSSCON-Hypervisor: use 3mdeb fork
m-iwanicki May 20, 2025
a38cd55
rpi4-minimal.dts: explain why I'm not using whole assigned memory region
m-iwanicki May 23, 2025
5536668
cache_test: fix comments and indentations
m-iwanicki May 23, 2025
5affce5
security_test: readme: add test commit
m-iwanicki May 23, 2025
811ed6a
security_test: readme: explain arguments
m-iwanicki May 23, 2025
d698853
rpi4-ws: readme: fix config directory
m-iwanicki May 23, 2025
4cc5fa5
env: build_rpi4.sh: add Cache Coloring security test as step 7
DaniilKl May 23, 2025
8a5eda6
Merge pull request #14 from 3mdeb/security-test-daniil
DaniilKl May 23, 2025
54eb0b2
security_test: add explicit cast
m-iwanicki May 26, 2025
2273b1a
Merge pull request #10 from 3mdeb/security-test
pietrushnic May 29, 2025
a51aeb1
rpi4-ws: add minimal baremetal rpi4 app with UART
m-iwanicki Jun 16, 2025
837ec93
CROSSCON-Hypervisor: use commit with backported mem abort fix
m-iwanicki Jun 16, 2025
4f7201f
mem separation: read and access address wanted by user
m-iwanicki Jun 17, 2025
d47d190
rpi4-ws: add baremetal mem demo
m-iwanicki Jun 18, 2025
115f26c
.gitignore: add binary file to ignores
m-iwanicki Jun 18, 2025
dba4275
CROSSCON-Hypervisor: add printk to data abort function
m-iwanicki Jun 18, 2025
b30dae0
memory-separation: include boot.S file
m-iwanicki Jun 18, 2025
a76658a
rpi4-ws: README.md: add memory separation test section
m-iwanicki Jun 27, 2025
5493c9e
mem_separation: use patch instead of commit
m-iwanicki Jun 30, 2025
8395933
rpi4-ws: mem separation: update README.md
m-iwanicki Jun 30, 2025
d671c96
Merge pull request #18 from 3mdeb/mem-separation
DaniilKl Jun 30, 2025
8b8aa25
build_rpi4: Fix steps
3mkusiak Jul 1, 2025
614969c
Merge pull request #19 from 3mdeb/build_rpi4-fix
3mkusiak Jul 1, 2025
4758f12
buildroot: make buildroot a submodule
3mkusiak Jul 1, 2025
c28e452
create_hyp_img: allow passing config
3mkusiak Jul 2, 2025
259e531
build_rpi4: Allow specifying device tree
3mkusiak Jul 2, 2025
45f6a66
build_rpi4: Avoid unsets
3mkusiak Jul 2, 2025
ddf80f7
rpi4-ws: Integrate building scripts
3mkusiak Jul 17, 2025
64f716b
rpi4-ws: README: Update
3mkusiak Jul 17, 2025
3bc0888
rpi4-ws: Move stuff from env
3mkusiak Jul 17, 2025
db1dc97
rpi4-ws: build.sh: Allow passing args
3mkusiak Jul 18, 2025
dbc1305
Merge pull request #20 from 3mdeb/prep-upstream
DaniilKl Jul 25, 2025
4a8244a
add CBA submodules
DaniilKl Aug 18, 2025
a5aeaa4
rpi4-ws: build.sh: add CBA stack building
DaniilKl Aug 18, 2025
086024b
cba: adhere to commits according to the context-based-auth-crosscon-demo
DaniilKl Aug 18, 2025
69c9e19
support: br-aarch64-cba.config: add buildroot config for CBA
DaniilKl Aug 19, 2025
613e7e5
rpi4-ws: rpi4-host-linux.dts: add
DaniilKl Aug 19, 2025
c7240d4
nexmon: add nexmon VM artifacts
DaniilKl Aug 19, 2025
1d2e83d
rpi4-ws: add dual GP dual TEE configuration
DaniilKl Aug 19, 2025
2366049
WIP: some small fixes
DaniilKl Aug 25, 2025
21bb98a
WIP: bisection part 1, exclude two VM's: Nexmon and PKCS#11 VMs
DaniilKl Aug 25, 2025
f7bdef9
WIP: bisection part 2: delete the CBA OPTEE OS
DaniilKl Aug 27, 2025
2d0d0bb
WIP: bisection: add the CBA OPTEE OS VM back
DaniilKl Aug 27, 2025
2702cd6
WIP: bisection: add the Nexmon VM back
DaniilKl Aug 27, 2025
dd90682
WIP: bisection: fix hypervisor data aborts
DaniilKl Aug 27, 2025
c65b225
WIP: bisection: fix CBA OPTEE OS shmem addresses
DaniilKl Aug 27, 2025
fa467e4
WIP: rpi4-ws: add PKCS#11 OPTEE OS VM
DaniilKl Aug 28, 2025
6641ce0
rpi4-ws: rpi4-per-vm-vTEE: fix second OPTEE OS probing issues
DaniilKl Aug 30, 2025
f6d7b81
cba_ta: update to the newest development branch
DaniilKl Sep 15, 2025
c292f2f
cba_ta: add fix for issue #6
DaniilKl Sep 22, 2025
343585c
Add script for building RISC-V solution
3mkusiak Sep 22, 2025
615f567
nexmon: add nexmon.bin
3mkusiak Sep 29, 2025
ecd7dec
rpi4-ws: build.sh: add --local-confs support
3mkusiak Sep 29, 2025
de88ea3
Merge pull request #24 from 3mdeb/add_riscv_script
DaniilKl Sep 29, 2025
b44a36f
Merge pull request #23 from 3mdeb/cba-integration
DaniilKl Oct 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.obj
*.elf
*.bin
*.img

# Linker output
*.ilk
Expand Down Expand Up @@ -55,5 +56,11 @@ dkms.conf
*.dtb
*to_buildroot*
*out*
*build*
*build*/
*.S

# Build specific files
rpi4-ws/arm-trusted-firmware/
rpi4-ws/firmware/
rpi4-ws/u-boot/

2 changes: 1 addition & 1 deletion CROSSCON-Hypervisor
1 change: 1 addition & 0 deletions env/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build.log
164 changes: 164 additions & 0 deletions env/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Use Debian base image
FROM debian:12.8

# Set environment variables
ENV MAKE_VERSION=4.2.1
ENV WORKDIR_PATH=/work
ENV USERNAME=user

# Set working directory
WORKDIR $WORKDIR_PATH

# Update package lists, install necessary dependencies
RUN apt-get update && \
apt-get install -y \
git \
wget \
build-essential \
libfdt1 \
libyaml-0-2 \
gdebi-core \
libuv1 \
procps \
librhash0 \
libarchive13 \
libc6 \
libcurl4 \
libexpat1 \
libgcc-s1 \
binutils \
flex \
bison \
pkg-config \
openssl \
libssl-dev \
cpio \
unzip \
rsync \
bc \
device-tree-compiler \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
python3-pyelftools \
gcc-riscv64-linux-gnu \
g++-riscv64-linux-gnu \
binutils-riscv64-linux-gnu \
libncurses-dev \
fdisk \
dosfstools \
libglib2.0-dev \
python3-distutils \
libpixman-1-dev \
parted \
udev \
sudo \
vim

# Install Make 4.2.1
RUN wget http://ftp.pl.debian.org/debian/pool/main/m/make-dfsg/make_4.2.1-1.2_amd64.deb \
&& dpkg -i make_4.2.1-1.2_amd64.deb \
&& rm -f make_4.2.1-1.2_amd64.deb

# Install dtc 1.6.1
COPY env/patches/dtc $WORKDIR_PATH/patches/dtc/

RUN git clone https://salsa.debian.org/crosstoolchain-team/device-tree-compiler.git \
&& cd device-tree-compiler \
&& git checkout debian/1.5.0-2 \
&& git apply $WORKDIR_PATH/patches/dtc/dtc-patch.patch \
&& make install \
&& rm -rf $WORKDIR_PATH/device-tree-compiler

# Install libssl1.1 (requirement for mkimage)
RUN wget http://ftp.pl.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_amd64.deb \
&& dpkg -i libssl1.1_1.1.1w-0+deb11u1_amd64.deb \
&& rm -f libssl1.1_1.1.1w-0+deb11u1_amd64.deb

# Install mkimage 20.10
RUN git clone https://github.com/u-boot/u-boot.git \
&& cd u-boot \
&& git checkout v2020.10 \
&& make tools-only_defconfig \
&& make tools \
&& cp tools/mkimage /usr/local/bin \
&& chmod +x /usr/local/bin/mkimage

# Install cmake-data 3.25
RUN wget http://ftp.pl.debian.org/debian/pool/main/c/cmake/cmake-data_3.25.1-1~bpo11+1_all.deb \
&& dpkg -i cmake-data_3.25.1-1~bpo11+1_all.deb \
&& rm -f cmake-data_3.25.1-1~bpo11+1_all.deb

# Install libjsoncpp24
RUN wget http://ftp.pl.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp24_1.9.4-4_amd64.deb \
&& dpkg -i libjsoncpp24_1.9.4-4_amd64.deb \
&& rm -f libjsoncpp24_1.9.4-4_amd64.deb

# Install Cmake 3.20.0
COPY env/patches/cmake $WORKDIR_PATH/patches/cmake/

RUN wget https://cmake.org/files/v3.20/cmake-3.20.0.tar.gz \
&& tar -xvf cmake-3.20.0.tar.gz \
&& cd cmake-3.20.0 \
&& git apply $WORKDIR_PATH/patches/cmake/001-search-path.diff \
&& git apply $WORKDIR_PATH/patches/cmake/003-libuv-application-services.diff \
&& git apply $WORKDIR_PATH/patches/cmake/custom-application-services.patch

RUN cd cmake-3.20.0 \
&& ./bootstrap \
&& make install \
&& cd .. && rm -rf cmake-3.20.0

# Install ninja 1.10.1
RUN wget http://ftp.pl.debian.org/debian/pool/main/n/ninja-build/ninja-build_1.10.1-1_amd64.deb \
&& dpkg -i ninja-build_1.10.1-1_amd64.deb \
&& rm -f ninja-build_1.10.1-1_amd64.deb

# Install BASH
RUN apt install bash -y
SHELL ["/bin/bash", "-c"]

# Fix missing "cryptography" python module
RUN apt install python3-cryptography -y

# Install Arm Bare-metal toolchain
RUN wget -O aarch64-none-elf.tar.xz "https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf.tar.xz?rev=981d8f7e91864070a466d852589598e2&hash=8D5397D4E41C99A96989ED813E8E95F0" \
&& unxz aarch64-none-elf.tar.xz \
&& tar -xvf aarch64-none-elf.tar \
&& rm -f aarch64-none-elf.tar


# Install Arm GNU toolchain
RUN wget -O aarch64-none-linux-gnu.tar.xz "https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz?rev=33c6e30e5ac64e6dba8f0431f2c35f1b&hash=9918A05BF47621B632C7A5C8D2BB438FB80A4480" \
&& unxz aarch64-none-linux-gnu.tar.xz \
&& tar -xvf aarch64-none-linux-gnu.tar \
&& rm -f aarch64-none-linux-gnu.tar

# Update PATH for arm developer toolchain
ENV PATH="$WORKDIR_PATH/gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf/bin:$PATH"
ENV PATH="$WORKDIR_PATH/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin:$PATH"

# Add support for aarch64 packages
RUN dpkg --add-architecture arm64

# Add trixie repository to install the libteec2 package for aarch64
RUN echo "deb http://deb.debian.org/debian trixie main" >> /etc/apt/sources.list && \
echo "deb-src http://deb.debian.org/debian trixie main" >> /etc/apt/sources.list && \
apt-get update && \
apt-get -t trixie install -y libteec2:arm64

# Clean cached apt, package lists and temprorary files to reduce image size
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Add non-root user and give sudo privileges
RUN useradd -m -s /bin/bash $USERNAME && \
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

USER $USERNAME

# SHELL must be set after USER if you're switching to bash
SHELL ["/bin/bash", "-c"]

# Make the starting directory is the CROSSCON Demos directory
WORKDIR $WORKDIR_PATH/crosscon
ENV ROOT=$WORKDIR_PATH/crosscon
99 changes: 99 additions & 0 deletions env/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Docker for CROSSCON Hypervisor

## Overview

The purpose of this repo is to provide the environment required for
compilation of the CROSSCON hypervisor.

## Clone the repository

Clone the repository by executing following command.

```bash
git clone --recurse-submodules [email protected]:3mdeb/CROSSCON-Hypervisor-and-TEE-Isolation-Demos.git crosscon-demos && \
cd crosscon-demos
```

## Build & run the container

Build docker container.

```bash
docker build -t crosscon_hv -f env/Dockerfile .
```

The resulting image will have a `crosscon_hv` tag.
After the image has been built, execute `env/run.sh` script to run
the container.

```bash
env/run.sh
```

## Building the rpi4-ws demo

Inside the container, use below script to build the demo `rpi4-ws` package.

```bash
env/build_rpi4.sh --all
```

The script steps follow exactly what can be found in
[the README](../rpi4-ws/README.md) on how to build the demo. This command will
perform all steps. Run the command without any parameters to see other options.

```bash
env/build_rpi4.sh
```

## Creating and flashing the image

The following command can be used to build the hypervisor and create an image
with all required files included.

```bash
sudo env/create_hyp_img.sh
```

The command will output the image to `/work/crosscon/crosscon-demo-img.img`.
Note: The command must be run with `sudo`.

The built image can be then flashed to SD card.

```bash
sudo dd if=./crosscon-demo-img.img of=<drive> bs=4M conv=fsync
```

## Running the image

Use UART to USB adapter to connect RPI to your machine and start up minicom.

```bash
minicom -D /dev/ttyUSB0 -b 115200
```

Supply power to RPI and hit any key when asked to stop u-boot from attempting
auto-boot.

```bash
[...]
scanning bus xhci_pci for devices... 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
U-Boot>
```

_Note: If you missed the timeframe, you can spam CTRL+C many times to achieve
same result._

Boot the image by manually loading it into the memory and "jumping" to it.

```bash
fatload mmc 0 0x200000 crossconhyp.bin; go 0x200000
```

## QEMU build

The docker image contains all the neccessary dependencies to build the QEMU
images as well (RISCV included), so all that needs to be done is following
the instructions from [the readme](../README.md).
Loading