OvmfPkg/IntelTdx/README.md
Intel Trust Domain Extension (TDX) is Intel Architecture extension to provide trusted, isolated VM execution by removing CSP software (hypervisor etc) from the TCB. TDX Virtual Firmware (TDVF) is an EDK II based project to enable UEFI support for TDX based Virtual Machines. It provides the capability to launch a TD.
The Intel TDX Virtual Firmware Design Guide is at https://www.intel.com/content/dam/develop/external/us/en/documents/tdx-virtual-firmware-design-guide-rev-1.01.pdf.
More information can be found at: https://www.intel.com/content/www/us/en/developer/articles/technical/intel-trust-domain-extensions.html
There are 2 configurations for TDVF.
Config-A:
Config-B:
For the build environment, consider reusing the existing EDKII infrastructure for containerized builds. See tianocore/containers for more details.
(Optional) Pull and run the tianocore/containers Ubuntu 22 Docker image:
docker run -it \
-v "${HOME}":"${HOME}" \
-e EDK2_DOCKER_USER_HOME="${HOME}" \
ghcr.io/tianocore/containers/ubuntu-22-dev:latest /bin/bash
Prepare the environment:
cd /path/to/edk2
. ./edksetup.sh
make -C BaseTools
Build the TDVF target:
Config-A (OvmfPkgX64):
# CC_MEASUREMENT disabled
build -p OvmfPkg/OvmfPkgX64.dsc -a X64 -t GCC -D CC_MEASUREMENT_ENABLE=FALSE -b RELEASE
# CC_MEASUREMENT enabled
build -p OvmfPkg/OvmfPkgX64.dsc -a X64 -t GCC -D CC_MEASUREMENT_ENABLE=TRUE -b RELEASE
Config-B (IntelTdxX64):
build -p OvmfPkg/IntelTdx/IntelTdxX64.dsc -a X64 -t GCC -b RELEASE
Assuming TDX-QEMU/TDX-KVM are already built, one can start a TD virtual machine as launching-a-tdx-vm:
qemu_system_x86 \
-accel kvm \
-cpu host \
-object tdx-guest,id=tdx0 \
-machine ...,confidential-guest-support=tdx0 \
-bios /path/to/OVMF.fd
Note: Avoid using the '-pflash' QEMU parameter with TDX configurations, as TDX lacks support for read-only memory slots.
KVM with TDX support:
QEMU with TDX support: