audk/OvmfPkg/IntelTdx
Gerd Hoffmann 82c1aa87f9 OvmfPkg/PlatformInitLib: move mmconfig to 0xe0000000
Also swap the ordering of 32bit PCI MMIO window on q35, i.e. use the
room between end of low memory and the start of the mmconfig bar.

With a typical configuration on modern qemu with gigabyte-aligned memory
the MMIO window start at 0x8000000, sized 1532 MB.  In case there is
memory present above 0x80000000 the window will start at 0xc0000000
instead, with 512 MB size.

This depends on qemu commit 4a4418369d6d ("q35: fix mmconfig and
PCI0._CRS"), so it raises the bar for the lowest supported version
to qemu 4.1 (released Aug 2019).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
2023-03-28 09:30:28 +00:00
..
PrePiHobListPointerLibTdx
Sec OvmfPkg: Remove UefiCpuLib from module INFs. 2023-03-10 08:23:56 +00:00
TdxHelperLib OvmfPkg/IntelTdx: Add PeiTdxHelperLib 2023-02-04 03:38:15 +00:00
IntelTdxX64.dsc OvmfPkg/PlatformInitLib: move mmconfig to 0xe0000000 2023-03-28 09:30:28 +00:00
IntelTdxX64.fdf
README OvmfPkg/IntelTdx: Update README 2023-02-04 13:19:10 +00:00

README

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

TDVF Overview
-------------

<b>Intel Trust Domain Extension (TDX)</b> is Intel Architecture extension
to provide trusted, isolated VM execution by removing CSP software
(hypervisor etc) from the TCB. <b>TDX Virtual Firmware (TDVF)</b> is an
EDK II based project to enable UEFI support for TDX based Virtual
Machines. It provides the capability to launch a TD.

The <b>Intel? TDX Virtual Firmware Design Guide</b> 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


Configurations and Features
----------------------------

There are 2 configurations for TDVF.

<b>Config-A:</b>
 - Merge the *basic* TDVF feature to existing OvmfX64Pkg.dsc. (Align
   with existing SEV)
 - Threat model: VMM is NOT out of TCB. (We don?t make things worse)
 - The OvmfX64Pkg.dsc includes SEV/TDX/normal OVMF basic boot capability.
   The final binary can run on SEV/TDX/normal OVMF.
 - No changes to existing OvmfPkgX64 image layout.
 - No need to remove features if they exist today.
 - PEI phase is NOT skipped in either Td or Non-Td.
 - RTMR based measurement is supported.
 - External inputs from Host VMM are measured, such as TdHob, CFV.
 - Other external inputs are measured, such as FW_CFG data, os loader,
   initrd, etc.

<b>Config-B:</b>
 - Add a standalone IntelTdx.dsc to a TDX specific directory for a *full*
   feature TDVF.(Align with existing SEV)
 - Threat model: VMM is out of TCB. (We need necessary change to prevent
   attack from VMM)
 - IntelTdx.dsc includes TDX/normal OVMF basic boot capability. The final
   binary can run on TDX/normal OVMF.
 - It might eventually merge with AmdSev.dsc, but NOT at this point of
   time. And we don?t know when it will happen. We need sync with AMD in
   the community after both of us think the solutions are mature to merge.
 - Need to add necessary security feature as mandatory requirement, such
   as RTMR based Trusted Boot support.
 - Need to measure the external input from Host VMM, such as TdHob, CFV.
 - Need to measure other external input, such as FW_CFG data, os loader,
   initrd, etc.
 - Need to remove unnecessary attack surfaces, such as network stack.

Build
------
- Build the TDVF (Config-A) target:
`cd /path/to/edk2`
`source edksetup.sh`
`build.sh -p OvmfPkg/OvmfPkgX64.dsc -a X64 -t GCC5`

- Build the TDVF (Config-B) target:
`cd /path/to/edk2`
`set PACKAGES_PATH=/path/to/edk2/OvmfPkg`
`source edksetup.sh`
`build.sh -p OvmfPkg/IntelTdx/IntelTdxX64.dsc -a X64 -t GCC5`

Usage
-----

Assuming TDX-QEMU/TDX-KVM are already built, one can start a TD virtual
machine as [launching-td-guest](https://github.com/intel/qemu-tdx/blob/tdx-qemu-upstream-rfc-v3/docs/system/i386/tdx.rst#launching-a-td-tdx-vm):

`qemu_system_x86 \`
`   -machine ...,confidential-guest-support=tdx0 \`
`   -object tdx-guest,id=tdx0,[sept-ve-disable=off] \`
`   -drive if=pflash,format=raw,unit=0,file=/path/to/OVMF_CODE.fd \`
`   -drive if=pflash,format=raw,unit=1,file=/path/to/OVMF_VARS.fd \`

Note:
TDX-QEMU/TDX-KVM are still in upstreaming progress. Please refer to:
 - kvm  : https://github.com/intel/tdx/tree/kvm-upstream
 - qemu : https://github.com/intel/qemu-tdx/blob/tdx-qemu-upstream-rfc-v3

Once above 2 upstreaming are completed a minimum qemu/kvm version will be updated here.