Michał Żygowski has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59515 )
Change subject: security/intel/txt: Remove unused region device
......................................................................
security/intel/txt: Remove unused region device
Region device is no longer used to locate BIOS ACM. Use new CBFS API
to map and unmap the file. Using rdev_munmap on the uninitialized
region device variable causes the platform to jump to a random adress.
TEST=Dell OptiPlex 9010 does not raise #UD exception when Intel TXT is
enabled, ACM SCHECK is successful
Signed-off-by: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Change-Id: I98afba35403d5d2cd9eeb7df6d1ca0171894e9d4
---
M src/security/intel/txt/common.c
1 file changed, 6 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/59515/1
diff --git a/src/security/intel/txt/common.c b/src/security/intel/txt/common.c
index 02ee29b..59d51fd 100644
--- a/src/security/intel/txt/common.c
+++ b/src/security/intel/txt/common.c
@@ -230,11 +230,11 @@
* Prepare to run the BIOS ACM: mmap it from the CBFS and verify that it
* can be launched. Returns pointer to ACM on success, NULL on failure.
*/
-static void *intel_txt_prepare_bios_acm(struct region_device *acm, size_t *acm_len)
+static void *intel_txt_prepare_bios_acm(size_t *acm_len)
{
void *acm_data = NULL;
- if (!acm || !acm_len)
+ if (!acm_len)
return NULL;
acm_data = cbfs_map(CONFIG_INTEL_TXT_CBFS_BIOS_ACM, acm_len);
@@ -307,10 +307,9 @@
/* Returns on failure, resets the computer on success */
void intel_txt_run_sclean(void)
{
- struct region_device acm;
size_t acm_len;
- void *acm_data = intel_txt_prepare_bios_acm(&acm, &acm_len);
+ void *acm_data = intel_txt_prepare_bios_acm(&acm_len);
if (!acm_data)
return;
@@ -338,7 +337,7 @@
*/
printk(BIOS_CRIT, "TEE-TXT: getsec_sclean could not launch the BIOS ACM.\n");
- rdev_munmap(&acm, acm_data);
+ cbfs_unmap(acm_data);
}
/*
@@ -348,10 +347,9 @@
*/
int intel_txt_run_bios_acm(const u8 input_params)
{
- struct region_device acm;
size_t acm_len;
- void *acm_data = intel_txt_prepare_bios_acm(&acm, &acm_len);
+ void *acm_data = intel_txt_prepare_bios_acm(&acm_len);
if (!acm_data)
return -1;
@@ -359,7 +357,7 @@
/* Call into assembly which invokes the referenced ACM */
getsec_enteraccs(input_params, (uintptr_t)acm_data, acm_len);
- rdev_munmap(&acm, acm_data);
+ cbfs_unmap(acm_data);
const uint64_t acm_status = read64((void *)TXT_SPAD);
if (acm_status & ACMERROR_TXT_VALID) {
--
To view, visit https://review.coreboot.org/c/coreboot/+/59515
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I98afba35403d5d2cd9eeb7df6d1ca0171894e9d4
Gerrit-Change-Number: 59515
Gerrit-PatchSet: 1
Gerrit-Owner: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-MessageType: newchange
Michał Żygowski has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59513 )
Change subject: security/intel/txt: Allow to set TXT BIOS Data Region version
......................................................................
security/intel/txt: Allow to set TXT BIOS Data Region version
TXT BIOS Data region version is checked by Trusted Boot code. Older
versions of TBoot may refuse to set up the MLE if BDR version is not
known. Provide an option to set the BDR version in case an older
TBoot code is used.
Signed-off-by: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Change-Id: Ic2550bd4008559bd47de9e35f8b1c7b52e6e0f5f
---
M src/security/intel/txt/Kconfig
M src/security/intel/txt/ramstage.c
2 files changed, 14 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/59513/1
diff --git a/src/security/intel/txt/Kconfig b/src/security/intel/txt/Kconfig
index 3648925..ae27b30 100644
--- a/src/security/intel/txt/Kconfig
+++ b/src/security/intel/txt/Kconfig
@@ -39,6 +39,19 @@
the MRC does not have an input to specify the size of DPR, so this
field is only used to check if the programmed size is large enough.
+config INTEL_TXT_BDR_VERSION
+ int "BIOS Data Region version"
+ range 2 6
+ default 5 if TPM1
+ default 6 if TPM2
+ help
+ Specify the TXT heap BIOS Data Region version. Sometimes when using
+ an older Trusted Boot version, it may report unsupported BIOS Data
+ Region version and refuse to set up the measured launch environment.
+ Setting lower version may work around such issue. Allowed values
+ currently range from 2 to 6.
+
+
config INTEL_TXT_TEST_BIOS_ACM_CALLING_CODE
bool "Test BIOS ACM calling code with NOP function"
help
diff --git a/src/security/intel/txt/ramstage.c b/src/security/intel/txt/ramstage.c
index 3ca766e..217d50c 100644
--- a/src/security/intel/txt/ramstage.c
+++ b/src/security/intel/txt/ramstage.c
@@ -215,10 +215,7 @@
} __packed data = {0};
/* TPM2.0 requires version 6 of BDT */
- if (CONFIG(TPM2))
- data.bdr.version = 6;
- else
- data.bdr.version = 5;
+ data.bdr.version = CONFIG_INTEL_TXT_BDR_VERSION;
data.bdr.no_logical_procs = dev_count_cpu();
--
To view, visit https://review.coreboot.org/c/coreboot/+/59513
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic2550bd4008559bd47de9e35f8b1c7b52e6e0f5f
Gerrit-Change-Number: 59513
Gerrit-PatchSet: 1
Gerrit-Owner: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-MessageType: newchange
Attention is currently required from: Lance Zhao, Raul Rangel, Martin Roth, Tim Wawrzynczak, Julius Werner.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59504 )
Change subject: acpi,Makefile: Add preload_acpi_dsdt
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
> The order right now has been hand crafted and analyzed extensively. […]
How much is going on in ELOG or APOB? Does the prefetch use case require a buffer for writes to flash?
As in, there's a region in RAM where data to write to flash is cached in a simple format. After reads completed, the prefetch routine flips a flag somewhere. The next attempt to write to flash doesn't add to the buffer but writes out the buffer to flash before writing its own data. From there, the only extra cost is looking at the flag.
It adds a fair amount of complexity, but OTOH with something like this we could really just initialize a list of files to fetch and their target addresses early on, rather than hand crafting things to ensure that things are ready just in time without blocking anything.
(If the DMA engine supports it, it might even be feasible to queue SPI writes as DMA engine commands to process after the reads are completed, so that they're also completed in parallel to the main task.)
--
To view, visit https://review.coreboot.org/c/coreboot/+/59504
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibf69ecb947811a2eec861018e3ba5f858155f1c3
Gerrit-Change-Number: 59504
Gerrit-PatchSet: 2
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Lance Zhao
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Lance Zhao
Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Martin Roth <martinroth(a)google.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Comment-Date: Sun, 21 Nov 2021 16:16:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Raul Rangel <rrangel(a)chromium.org>
Comment-In-Reply-To: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Comment-In-Reply-To: Julius Werner <jwerner(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Martin Roth.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59511 )
Change subject: Makefiles: Hide skipping submodule info unless V=1
......................................................................
Patch Set 1: Code-Review+2
(1 comment)
File Makefile.inc:
https://review.coreboot.org/c/coreboot/+/59511/comment/3111f53a_5ce0f76a
PS1, Line 214:
nit: is this extra line intended?
--
To view, visit https://review.coreboot.org/c/coreboot/+/59511
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7b5c7f1f79dcc88793a9a21f2e92e7accc5de1e0
Gerrit-Change-Number: 59511
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-CC: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Martin Roth <martinroth(a)google.com>
Gerrit-Comment-Date: Sun, 21 Nov 2021 15:50:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment