Skip to content

Conversation

@alarmfox
Copy link
Collaborator

Description

This PR improves the TSM so that we can load an elf as a VM. The elf loading is performed by the untrusted OS which maps pages into the trusted partition (managed by the TSM). This example can be performed using the gdb_covh_create_tvm_from_elf-py.

The TVM cannot interacts with any external device, but it can be some code like:

    .section .text
_start:
    /* Reset registers */
    mv ra, zero
    mv gp, zero
    mv tp, zero
    mv t0, zero
    mv t1, zero
    mv t2, zero
    mv s0, zero
    mv s1, zero
    mv a0, zero
    mv a1, zero
    mv a2, zero
    mv a3, zero
    mv a4, zero
    mv a5, zero
    mv a6, zero
    mv a7, zero
    mv s2, zero
    mv s3, zero
    mv s4, zero
    mv s5, zero
    mv s6, zero
    mv s7, zero
    mv s8, zero
    mv s9, zero
    mv s10, zero
    mv s11, zero
    mv t3, zero
    mv t4, zero
    mv t5, zero
    mv t6, zero

    /* Hang */
1:  j 1b

Which can be compiled with:

/riscv64-unknown-linux-gnu-gcc -nostdlib -nostartfiles -Wl,-Ttext=0x1000 a.S

Other changes

  • Remove environment.sh and export variable from Makefile
  • Update documentation on how to run examples
  • Easy debug examples with make debug GDB_COVE_SCRIPT=<path to script>
  • Computing SHA384 for TVM data in measured pages
  • Updated Dockerfile and improved build-system

alarmfox added 30 commits August 2, 2025 16:05
# This is the 1st commit message:

Adding examples

# This is the commit message #2:

Added config.mk for general configuration

# This is the commit message #3:

Removed -c

# This is the commit message #4:

Formatting

# This is the commit message #5:

Working C example

# This is the commit message #6:

New demo

# This is the commit message #7:

Added details

# This is the commit message #8:

Added folders
# This is the 1st commit message:

Adding examples

# This is the commit message #2:

Added config.mk for general configuration

# This is the commit message #3:

Removed -c

# This is the commit message #4:

Formatting

# This is the commit message #5:

Working C example

# This is the commit message #6:

New demo

# This is the commit message #7:

Added details

# This is the commit message #8:

Added folders

# This is the commit message #9:

Simple README.md

# This is the commit message #10:

Added pre-commit basic configuration

# This is the commit message #11:

Updated default hooks

# This is the commit message #12:

Rename: src -> tsm-driver

# This is the commit message #13:

Added author name and changed PREFIX to CROSS_COMPILE

# This is the commit message #14:

More standard way of passing CROSS_COMPILE: now includes -

# This is the commit message #15:

Using native toolchain if CROSS_COMPILE is not defined

# This is the commit message #16:

Fix usage section

# This is the commit message #17:

Added static and nostdlib to helloworld

# This is the commit message #18:

More parameters from config.mk
 - rust project initializtion for bare metal riscv programming integrating
 - integration with opensbi using bindgen
 - setup Docker environment
 - working OpenSBI integration
 - scripts refactoring
 - adding devcontainer
 - cove extension scratch
fix: aligning 4 byte the trap handler
Refactored trap.rs
working hypervisor with shadowfax
Moved SBI extensions in sbi/
refactor: added build time jump address, debug! macro, embed-elf
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.

2 participants