| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| Upcoming release - coreboot 4.11 | ||
| ================================ | ||
|
|
||
| The 4.11 release is planned for October 2019 | ||
|
|
||
| Update this document with changes that should be in the release | ||
| notes. | ||
| * Please use Markdown. | ||
| * See the [4.9](coreboot-4.9-relnotes.md) and [4.10](coreboot-4.10-relnotes.md) | ||
| release notes for the general format. | ||
| * The chip and board additions and removals will be updated right | ||
| before the release, so those do not need to be added. | ||
|
|
||
| Significant changes | ||
| ------------------- | ||
|
|
||
| ### Add significant changes here |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # Intel Authenticated Code Modules | ||
|
|
||
| The Authenticated Code Modules (ACMs) are Intel digitally signed modules | ||
| that contain code to be run before the traditional x86 CPU reset vector. | ||
| The ACMs can be invoked at runtime through the GETSEC instruction, too. | ||
|
|
||
| A platform that wants to use Intel TXT must use two ACMs: | ||
| 1. BIOS ACM | ||
| * The BIOS ACM must be present in the boot flash. | ||
| * The BIOS ACM must be referenced by the [FIT]. | ||
| 2. SINIT ACM | ||
| * The SINIT ACM isn't referenced by the [FIT]. | ||
| * The SINIT ACM should be provided by the boot firmware, but bootloaders | ||
| like [TBOOT] are able to load them from the filesystem as well. | ||
|
|
||
| ## Retrieving ACMs | ||
|
|
||
| The ACMs can be downloaded on Intel's website: | ||
| [Intel Trusted Execution Technology](https://software.intel.com/en-us/articles/intel-trusted-execution-technology) | ||
|
|
||
| If you want to extract the BLOB from vendor firmware you can search for the | ||
| string ``LCP_POLICY_DATA`` or ``TXT``. | ||
|
|
||
| ## Header | ||
|
|
||
| Every ACM has a fixed size header: | ||
|
|
||
| ```c | ||
| /* | ||
| * ACM Header v0.0 without dynamic part | ||
| * Chapter A.1 | ||
| * Intel TXT Software Development Guide (Document: 315168-015) | ||
| */ | ||
| struct acm_header_v0 { | ||
| uint16_t module_type; | ||
| uint16_t module_sub_type; | ||
| uint32_t header_len; | ||
| uint16_t header_version[2]; | ||
| uint16_t chipset_id; | ||
| uint16_t flags; | ||
| uint32_t module_vendor; | ||
| uint32_t date; | ||
| uint32_t size; | ||
| uint16_t txt_svn; | ||
| uint16_t se_svn; | ||
| uint32_t code_control; | ||
| uint32_t error_entry_point; | ||
| uint32_t gdt_limit; | ||
| uint32_t gdt_ptr; | ||
| uint32_t seg_sel; | ||
| uint32_t entry_point; | ||
| uint8_t reserved2[63]; | ||
| } __packed; | ||
| ``` | ||
|
|
||
| [FIT]: ../../soc/intel/fit.md | ||
| [TBOOT]: https://sourceforge.net/p/tboot/wiki/Home/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| # Intel Trusted Execution Technology | ||
|
|
||
| Intel TXT allows | ||
| 1. Attestation of the authenticity of a platform and its operating system. | ||
| 2. Assuring that an authentic operating system starts in a | ||
| trusted environment, which can then be considered trusted. | ||
| 3. Providing of a trusted operating system with additional | ||
| security capabilities not available to an unproven one. | ||
|
|
||
| Intel TXT requirements: | ||
|
|
||
| 1. Intel TXT requires a **TPM** to measure parts of the firmware before it's | ||
| run on the BSP. | ||
| 2. Intel TXT requires signed **Authenticated Code Modules** ([ACM]s), provided | ||
| by Intel. | ||
| 3. Intel TXT requires **CPU and Chipset** support (supported since | ||
| Intel Core 2 Duo/ICH9). | ||
|
|
||
| ## Authenticated Code Modules | ||
|
|
||
| The ACMs are Intel digitally signed modules that contain code to be run | ||
| before the traditional x86 CPU reset vector. | ||
|
|
||
| More details can be found here: [Intel ACM]. | ||
|
|
||
| ## Modified bootflow with Intel TXT | ||
|
|
||
| With Intel TXT the first instruction executed on the BSP isn't the | ||
| *reset vector*, but the [Intel ACM]. | ||
| It initializes the TPM and measures parts of the firmware, the IBB. | ||
|
|
||
| ### Marking the Initial Boot Block | ||
|
|
||
| Individual files in the CBFS can be marked as IBB. | ||
|
|
||
| More details can be found in the [Intel TXT IBB] chapter. | ||
|
|
||
| ### Measurements | ||
| The IBBs (Initial Boot Blocks) are measured into TPM's PCR0 by the BIOS [ACM] | ||
| before the CPU reset vector is executed. To indentify the regions that need | ||
| to be measured, the [FIT] contains one ore multiple *Type 7* entries, that | ||
| point to the IBBs. | ||
|
|
||
| ### Authentication | ||
|
|
||
| After the IBBs have been measured, the ACM decides if the boot firmware is | ||
| trusted. There exists two validation modes: | ||
| 1. HASH Autopromotion | ||
| * Uses a known good HASH stored in TPM NVRAM | ||
| * Doesn't allow to boot a fallback IBB | ||
| 2. Signed BIOS policy | ||
| * Uses a signed policy stored in flash containing multiple HASHes | ||
| * The public key HASH of BIOS policy is burned into TPM by manufacturer | ||
| * Can be updated by firmware | ||
| * Allows to boot a fallback IBB | ||
|
|
||
| At the moment only *Autopromotion mode* is implemented and tested well. | ||
|
|
||
| In the next step the ACM terminates and the regular x86 CPU reset vector | ||
| is being executed on the BSP. | ||
|
|
||
| ### Protecting Secrets in Memory | ||
|
|
||
| Intel TXT sets the `Secrets in Memory` bit, whenever the launch of the SINIT | ||
| ACM was successful. | ||
| The bit is reset when leaving the *MLE* by a regular shutdown or by removing | ||
| the CMOS battery. | ||
|
|
||
| When `Secrets in Memory` bit is set and the IBB isn't trusted, the memory | ||
| controller won't be unlocked, resulting in a platform that cannot access DRAM. | ||
|
|
||
| When `Secrets in Memory` bit is set and the IBB is trusted, the memory | ||
| controller will be unlocked, and it's the responsibility of the firmware to | ||
| [clear all DRAM] and wipe any secrets of the MLE. | ||
| The platform will be reset after all DRAM has been wiped and will boot | ||
| with the `Secrets in Memory` bit cleared. | ||
|
|
||
| ### Configuring protected regions for SINIT ACM | ||
|
|
||
| The memory regions used by the SINIT ACM need to be prepared and protected | ||
| against DMA attacks. | ||
| The SINIT ACM as well as the SINIT handoff data are placed in memory. | ||
|
|
||
| ### Locking TXT register | ||
|
|
||
| As last step the TXT registers are locked. | ||
|
|
||
| Whenever the SINIT ACM is invoked, it verifies that the hardware is in the | ||
| correct state. If it's not the SINIT ACM will reset the platform. | ||
|
|
||
| ## For developers | ||
| ### Configuring Intel TXT in Kconfig | ||
| Enable ``TEE_INTEL_TXT`` and set the following: | ||
|
|
||
| ``TEE_INTEL_TXT_BIOSACM_FILE`` to the path of the BIOS ACM provided by Intel | ||
|
|
||
| ``TEE_INTEL_TXT_SINITACM_FILE`` to the path of the SINIT ACM provided by Intel | ||
| ### Print TXT status as early as possible | ||
| Add platform code to print the TXT status as early as possible, as the register | ||
| is cleared on cold reset. | ||
|
|
||
| ## References | ||
| More information can be found here: | ||
| * [Intel TXT Software Development Guide] | ||
| * [Intel TXT enabling] | ||
| * [FIT] | ||
| * [Intel TXT Lab Handout] | ||
|
|
||
| [Intel TXT IBB]: txt_ibb.md | ||
| [FIT]: ../../soc/intel/fit.md | ||
| [Intel ACM]: acm.md | ||
| [ACM]: acm.md | ||
| [FIT table]: ../../soc/intel/fit.md | ||
| [clear all DRAM]: ../memory_clearing.md | ||
| [Intel TXT Lab Handout]: https://downloadmirror.intel.com/18931/eng/Intel%20TXT%20LAB%20Handout.pdf | ||
| [Intel TXT Software Development Guide]: https://www.intel.com/content/dam/www/public/us/en/documents/guides/intel-txt-software-development-guide.pdf | ||
| [Intel TXT enabling]: https://www.intel.com/content/dam/www/public/us/en/documents/guides/txt-enabling-guide.pdf |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Intel TXT Initial Boot Block | ||
|
|
||
| The Initial Boot Block (IBB) consists out of one or more files in the CBFS. | ||
|
|
||
| ## Constraints | ||
|
|
||
| The IBB must follow the following constrains: | ||
| * One IBB must contain the reset vector as well as the [FIT table]. | ||
| * The IBB should be as small as possible. | ||
| * The IBBs must not overlap each other. | ||
| * The IBB might overlap with microcode. | ||
| * The IBB must not overlap the BIOS ACM. | ||
| * The IBB size must be a multiple of 16. | ||
| * Either one of the following: | ||
| * The IBB must be able to train the main system memory and clear all secrets. | ||
| * If the IBB cannot train the main system memory it must verify the code | ||
| that can train the main system memory and is able to clear all secrets. | ||
|
|
||
| ## Identification | ||
|
|
||
| To add the IBBs to the [FIT], all CBFS files are added using the `cbfstool` | ||
| with the `--ibb` flag set. | ||
| The flags sets the CBFS file attribute tag to LE `' IBB'`. | ||
|
|
||
| The make system in turn adds all those files to the [FIT] as type 7. | ||
|
|
||
| ## Intel TXT measurements | ||
|
|
||
| Each IBB is measured and extended into PCR0 by [Intel TXT], before the CPU | ||
| reset vector is executed. | ||
| The IBBs are measured in the order they are listed in the [FIT]. | ||
|
|
||
| ## FIT schematic | ||
|
|
||
| ![][fit_ibb] | ||
|
|
||
| [fit_ibb]: fit_ibb.svg | ||
| [FIT]: ../../soc/intel/fit.md | ||
| [Intel TXT]: txt.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| CONFIG_BOARD_EMULATION_QEMU_RISCV_RV64=y | ||
| CONFIG_RISCV_OPENSBI=y |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| CONFIG_VENDOR_UP=y | ||
| CONFIG_VBOOT=y |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ choice | |
| default GRUB2_STABLE | ||
|
|
||
| config GRUB2_STABLE | ||
| bool "2.04" | ||
| help | ||
| Stable GRUB2 version | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,20 @@ | ||
| config ARCH_PPC64 | ||
| bool | ||
|
|
||
| config ARCH_BOOTBLOCK_PPC64 | ||
| bool | ||
| select ARCH_PPC64 | ||
| select BOOTBLOCK_CUSTOM | ||
| select C_ENVIRONMENT_BOOTBLOCK | ||
|
|
||
| config ARCH_VERSTAGE_PPC64 | ||
| bool | ||
| select ARCH_PPC64 | ||
|
|
||
| config ARCH_ROMSTAGE_PPC64 | ||
| bool | ||
| select ARCH_PPC64 | ||
|
|
||
| config ARCH_RAMSTAGE_PPC64 | ||
| bool | ||
| select ARCH_PPC64 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * This file is part of the coreboot project. | ||
| * | ||
| * Copyright (C) 2019 9elements Agency GmbH <patrick.rudolph@9elements.com> | ||
| * | ||
| * This program is free software; you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation; version 2 of the License. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| */ | ||
|
|
||
| #include <sbi/fw_dynamic.h> | ||
| #include <arch/boot.h> | ||
| /* DO NOT INLCUDE COREBOOT HEADERS HERE */ | ||
|
|
||
| void run_opensbi(const int hart_id, | ||
| const void *fdt, | ||
| const void *opensbi, | ||
| const void *payload, | ||
| const int payload_mode) | ||
| { | ||
| struct fw_dynamic_info info = { | ||
| .magic = FW_DYNAMIC_INFO_MAGIC_VALUE, | ||
| .version = FW_DYNAMIC_INFO_VERSION_MAX, | ||
| .next_mode = payload_mode, | ||
| .next_addr = (uintptr_t)payload, | ||
| }; | ||
|
|
||
| csr_write(mepc, opensbi); | ||
| asm volatile ( | ||
| "mv a0, %0\n\t" | ||
| "mv a1, %1\n\t" | ||
| "mv a2, %2\n\t" | ||
| "mret" : | ||
| : "r"(hart_id), "r"(fdt), "r"(&info) | ||
| : "a0", "a1", "a2"); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,8 +24,6 @@ | |
| * linker script. | ||
| */ | ||
|
|
||
| #include <arch/stages.h> | ||
| #include <arch/smp/smp.h> | ||
| #include <rules.h> | ||
|
|
||