Julius Werner has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35351 )
Change subject: Revert "security/tpm/tss/tcg-2.0: Add multi digits support to tlcl_extend()"
......................................................................
Revert "security/tpm/tss/tcg-2.0: Add multi digits support to tlcl_extend()"
This reverts commit fdb9805d6884090fd7bf62dbdf9c858692e55fb4.
CB:33252 wasn't reviewed by a TPM maintainer and breaks abstraction
layers (pulling TSS-details into TSPI, completely changing
interpretation of the arguments to tlcl_extend() based on TSS version).
It's also not clear why it was implemented the way it was (should have
been much easier and cleaner ways to achieve the same thing).
Since the author is not reacting, let's revert it for now. It can be
cleaned up and resubmitted later.
Change-Id: Ice44f55c75a0acc07794fe41c757a7bca75406eb
---
M src/security/tpm/tspi/tspi.c
M src/security/tpm/tss/tcg-2.0/tss.c
M src/security/tpm/tss/tcg-2.0/tss_structures.h
3 files changed, 13 insertions(+), 88 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/35351/1
diff --git a/src/security/tpm/tspi/tspi.c b/src/security/tpm/tspi/tspi.c
index e64e04f..4698a4d 100644
--- a/src/security/tpm/tspi/tspi.c
+++ b/src/security/tpm/tspi/tspi.c
@@ -4,7 +4,6 @@
* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
* Copyright 2017 Facebook Inc.
* Copyright 2018 Siemens AG
- * Copyright 2019 Eltan B.V.
*
* 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
@@ -21,7 +20,6 @@
#include <security/tpm/tspi.h>
#include <security/tpm/tss.h>
#include <stdlib.h>
-#include <string.h>
#if CONFIG(VBOOT)
#include <vb2_api.h>
#include <vb2_sha.h>
@@ -211,28 +209,7 @@
if (!digest)
return TPM_E_IOERROR;
-#if CONFIG(TPM2)
- TPML_DIGEST_VALUES tpml_digests;
-
- tpml_digests.count = 1;
- switch (digest_algo) {
- case VB2_HASH_SHA1:
- tpml_digests.digests[0].hashAlg = TPM_ALG_SHA1;
- memcpy(tpml_digests.digests[0].digest.sha1,
- digest, SHA1_DIGEST_SIZE);
- break;
- case VB2_HASH_SHA256:
- tpml_digests.digests[0].hashAlg = TPM_ALG_SHA256;
- memcpy(tpml_digests.digests[0].digest.sha256,
- digest, SHA256_DIGEST_SIZE);
- break;
- default:
- return TPM_E_IOERROR;
- }
- result = tlcl_extend(pcr, (uint8_t *)&tpml_digests, NULL);
-#else
result = tlcl_extend(pcr, digest, NULL);
-#endif
if (result != TPM_SUCCESS)
return result;
diff --git a/src/security/tpm/tss/tcg-2.0/tss.c b/src/security/tpm/tss/tcg-2.0/tss.c
index d9deba5..16e40fe 100644
--- a/src/security/tpm/tss/tcg-2.0/tss.c
+++ b/src/security/tpm/tss/tcg-2.0/tss.c
@@ -127,68 +127,24 @@
}
/*
- * The caller will provide the digest in a 32 byte buffer
+ * The caller will provide the digest in a 32 byte buffer, let's consider it a
+ * sha256 digest.
*/
uint32_t tlcl_extend(int pcr_num, const uint8_t *in_digest,
uint8_t *out_digest)
{
struct tpm2_pcr_extend_cmd pcr_ext_cmd;
struct tpm2_response *response;
- int i;
- TPML_DIGEST_VALUES *tpml_digests;
pcr_ext_cmd.pcrHandle = HR_PCR + pcr_num;
- tpml_digests = (TPML_DIGEST_VALUES *)in_digest;
- pcr_ext_cmd.digests.count = tpml_digests->count;
-
- for (i = 0; i < tpml_digests->count ; i++) {
- pcr_ext_cmd.digests.digests[i].hashAlg =
- tpml_digests->digests[i].hashAlg;
- switch (tpml_digests->digests[i].hashAlg) {
- case TPM_ALG_SHA1:
- memcpy(pcr_ext_cmd.digests.digests[i].digest.sha1,
- tpml_digests->digests[i].digest.sha1,
- SHA1_DIGEST_SIZE);
- break;
- case TPM_ALG_SHA256:
- memcpy(pcr_ext_cmd.digests.digests[i].digest.sha256,
- tpml_digests->digests[i].digest.sha256,
- SHA256_DIGEST_SIZE);
- break;
- case TPM_ALG_SHA384:
- memcpy(pcr_ext_cmd.digests.digests[i].digest.sha384,
- tpml_digests->digests[i].digest.sha384,
- SHA384_DIGEST_SIZE);
- break;
- case TPM_ALG_SHA512:
- memcpy(pcr_ext_cmd.digests.digests[i].digest.sha512,
- tpml_digests->digests[i].digest.sha512,
- SHA512_DIGEST_SIZE);
- break;
- case TPM_ALG_SM3_256:
- memcpy(pcr_ext_cmd.digests.digests[i].digest.sm3_256,
- tpml_digests->digests[i].digest.sm3_256,
- SM3_256_DIGEST_SIZE);
- break;
- }
- }
+ pcr_ext_cmd.digests.count = 1;
+ pcr_ext_cmd.digests.digests[0].hashAlg = TPM_ALG_SHA256;
+ memcpy(pcr_ext_cmd.digests.digests[0].digest.sha256, in_digest,
+ sizeof(pcr_ext_cmd.digests.digests[0].digest.sha256));
response = tpm_process_command(TPM2_PCR_Extend, &pcr_ext_cmd);
- /*
- * Check if we are invalidating the pcrs, ignore the error if this is
- * the case
- */
- if ((tpml_digests->count == 1) &&
- (tpml_digests->digests[0].hashAlg == TPM_ALG_ERROR) &&
- response && (response->hdr.tpm_code & ~TPM_RC_N_MASK) ==
- (TPM_RC_P | TPM_RC_HASH)) {
- printk(BIOS_SPEW, "%s: TPM_RC_HASH returned this is"
- " expected\n", __func__);
- return TPM_SUCCESS;
- }
-
- printk(BIOS_INFO, "%s: response is 0x%x\n",
+ printk(BIOS_INFO, "%s: response is %x\n",
__func__, response ? response->hdr.tpm_code : -1);
if (!response || response->hdr.tpm_code)
return TPM_E_IOERROR;
diff --git a/src/security/tpm/tss/tcg-2.0/tss_structures.h b/src/security/tpm/tss/tcg-2.0/tss_structures.h
index 1530613..6a017bbb 100644
--- a/src/security/tpm/tss/tcg-2.0/tss_structures.h
+++ b/src/security/tpm/tss/tcg-2.0/tss_structures.h
@@ -97,12 +97,6 @@
space is defined by the lower 16 bits. */
#define TPM_CC_VENDOR_BIT_MASK 0x20000000
-/* Table 15 - TPM_RC Constants (Actions) */
-#define RC_FMT1 (TPM_RC)(0x080)
-#define TPM_RC_HASH (TPM_RC)(RC_FMT1 + 0x003)
-#define TPM_RC_P (TPM_RC)(0x040)
-#define TPM_RC_N_MASK (TPM_RC)(0xF00)
-
/* Startup values. */
#define TPM_SU_CLEAR 0
#define TPM_SU_STATE 1
@@ -317,13 +311,12 @@
TPM2B b;
} TPM2B_MAX_NV_BUFFER;
-/* Table 66 - TPMU_HA Union */
+/*
+ * This is a union, but as of now we support just one digest - sha256, so
+ * there is just one element.
+ */
typedef union {
- uint8_t sha1[SHA1_DIGEST_SIZE];
- uint8_t sha256[SHA256_DIGEST_SIZE];
- uint8_t sm3_256[SM3_256_DIGEST_SIZE];
- uint8_t sha384[SHA384_DIGEST_SIZE];
- uint8_t sha512[SHA512_DIGEST_SIZE];
+ uint8_t sha256[SHA256_DIGEST_SIZE];
} TPMU_HA;
typedef struct {
@@ -331,10 +324,9 @@
TPMU_HA digest;
} TPMT_HA;
-/* Table 96 -- TPML_DIGEST_VALUES Structure <I/O> */
typedef struct {
uint32_t count;
- TPMT_HA digests[HASH_COUNT];
+ TPMT_HA digests[1]; /* Limit max number of hashes to 1. */
} TPML_DIGEST_VALUES;
struct nv_read_response {
--
To view, visit https://review.coreboot.org/c/coreboot/+/35351
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ice44f55c75a0acc07794fe41c757a7bca75406eb
Gerrit-Change-Number: 35351
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-MessageType: newchange
Hello Manoj Gupta,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/35316
to review the following change.
Change subject: futility: Use HOSTPKGCONFIG for host PKG_CONFIG
......................................................................
futility: Use HOSTPKGCONFIG for host PKG_CONFIG
futility is built for the host. However, when cross-compiling,
the target's pkg-config is called to get the library paths which
can add paths from the cross-compilation tree instead of host.
e.g. /build/elm/usr/bin/pkg-config gets called instead of /usr/bin/pkg-config
. /build/elm/usr/bin/pkg-config adds the paths specific to the
cross-compilation target e.g. /build/elm/usr/lib instead of /usr/lib.
This causes linker to complain that files in library paths do not
match the architecture. BFD produces a warning while LLD errors out.
Fix this by passing PKG_CONFIG from host when building futility.
BUG=chromium:999217
TEST=coreboot builds
BRANCH=None
Cq-Depend: chromium:1778519
Change-Id: Id3afbf25001cf3daa72f36a290c93136cf9f162d
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
M util/futility/Makefile.inc
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/35316/1
diff --git a/util/futility/Makefile.inc b/util/futility/Makefile.inc
index 782953e..87764a7 100644
--- a/util/futility/Makefile.inc
+++ b/util/futility/Makefile.inc
@@ -5,6 +5,7 @@
unset CFLAGS LDFLAGS; $(MAKE) -C $(VBOOT_SOURCE) \
BUILD=$(abspath $@/../..) \
CC="$(HOSTCC)" \
+ PKG_CONFIG="$(HOSTPKGCONFIG)" \
V=$(V) \
$(abspath $@)
--
To view, visit https://review.coreboot.org/c/coreboot/+/35316
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id3afbf25001cf3daa72f36a290c93136cf9f162d
Gerrit-Change-Number: 35316
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Manoj Gupta <manojgupta(a)google.com>
Gerrit-MessageType: newchange
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35301 )
Change subject: intel/fsp2_0: Add help text for FSP_TEMP_RAM_SIZE Kconfig
......................................................................
intel/fsp2_0: Add help text for FSP_TEMP_RAM_SIZE Kconfig
BUG=b:140268415
Change-Id: Ic1463181b4a9dca136d00cb2f7e3cce4f7e57bd6
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
---
M src/drivers/intel/fsp2_0/Kconfig
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/35301/1
diff --git a/src/drivers/intel/fsp2_0/Kconfig b/src/drivers/intel/fsp2_0/Kconfig
index 541ec47..d0d582f 100644
--- a/src/drivers/intel/fsp2_0/Kconfig
+++ b/src/drivers/intel/fsp2_0/Kconfig
@@ -156,6 +156,11 @@
hex
default 0x10000
depends on FSP_USES_CB_STACK
+ help
+ The amount of anticipated heap usage in CAR by FSP to setup HOB.
+ This configuration is applicable with FSP specification using single
+ stack implementation.
+ Sync this value with Platform FSP integration guide recommendation.
config VERIFY_HOBS
bool "Verify the FSP hand-off-blocks"
--
To view, visit https://review.coreboot.org/c/coreboot/+/35301
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic1463181b4a9dca136d00cb2f7e3cce4f7e57bd6
Gerrit-Change-Number: 35301
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-MessageType: newchange
Hello Kyösti Mälkki,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/34995
to review the following change.
Change subject: arch/x86: Cache the TSEG region at the top of ram
......................................................................
arch/x86: Cache the TSEG region at the top of ram
This patch helps to save additional ~6ms of booting time in
normal and s3 resume on CML-hatch.
Change-Id: I59432c02e04af1b931d77de3f6652b0327ca82bb
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
---
M src/arch/x86/postcar_loader.c
1 file changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/34995/1
diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c
index bceed6c..408d155 100644
--- a/src/arch/x86/postcar_loader.c
+++ b/src/arch/x86/postcar_loader.c
@@ -20,6 +20,7 @@
#include <cpu/cpu.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/mtrr.h>
+#include <cpu/x86/smm.h>
#include <program_loading.h>
#include <rmodule.h>
#include <romstage_handoff.h>
@@ -149,6 +150,23 @@
set_var_mtrr(mtrr, base, size, MTRR_TYPE_WRPROT);
}
+/*
+ * Cache the TSEG region at the top of ram. This region is
+ * not restricted to SMM mode until SMM has been relocated.
+ * By setting the region to cacheable it provides faster access
+ * when relocating the SMM handler as well as using the TSEG
+ * region for other purposes.
+ */
+static void enable_tseg_cache(struct postcar_frame *pcf)
+{
+ uintptr_t smm_base;
+ size_t smm_size;
+
+ smm_region(&smm_base, &smm_size);
+ postcar_frame_add_mtrr(pcf, smm_base, smm_size,
+ MTRR_TYPE_WRBACK);
+}
+
void postcar_frame_setup_top_of_dram_usage(struct postcar_frame *pcf,
uintptr_t addr, size_t size, int type)
{
@@ -159,6 +177,9 @@
*/
if (!acpi_is_wakeup_s3())
enable_top_of_dram_cache(addr, size);
+
+ enable_tseg_cache(pcf);
+
postcar_frame_add_mtrr(pcf, addr, size, type);
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/34995
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I59432c02e04af1b931d77de3f6652b0327ca82bb
Gerrit-Change-Number: 34995
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-MessageType: newchange
Michael Niewöhner has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35294 )
Change subject: superio/common: fix generic ssdt
......................................................................
superio/common: fix generic ssdt
ITR2 is specified twice here, which leads to the following error message
in Linux:
[ 0.263591] ACPI BIOS Error (bug): Failure creating named object
[\_SB.PCI0.LPCB.SIO0.ITR2], AE_ALREADY_EXISTS (20190509/dsfield-633)
By comparing multiple dsdt/ssdt's I was able to guess how this
(hopefully) should look like instead.
WARNING: This is based on a guess! Please verify this!
Change-Id: I4f3307d0992fcf5ad192f412c2bd15d02572a6b0
Signed-off-by: Michael Niewöhner <foss(a)mniewoehner.de>
---
M src/superio/common/generic.c
1 file changed, 2 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/35294/1
diff --git a/src/superio/common/generic.c b/src/superio/common/generic.c
index bffa9f3..1f8063f 100644
--- a/src/superio/common/generic.c
+++ b/src/superio/common/generic.c
@@ -115,11 +115,9 @@
FIELDLIST_OFFSET(0x70),
FIELDLIST_NAMESTR("INTR", 4),
FIELDLIST_OFFSET(0x71),
- FIELDLIST_NAMESTR("INTT", 2),
+ FIELDLIST_NAMESTR("INTT", 4),
FIELDLIST_OFFSET(0x72),
- FIELDLIST_NAMESTR("ITR2", 4),
- FIELDLIST_OFFSET(0x73),
- FIELDLIST_NAMESTR("ITR2", 2),
+ FIELDLIST_NAMESTR("INT1", 8),
FIELDLIST_OFFSET(0x74),
FIELDLIST_NAMESTR("DMCH", 8),
FIELDLIST_OFFSET(0xE0),
--
To view, visit https://review.coreboot.org/c/coreboot/+/35294
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4f3307d0992fcf5ad192f412c2bd15d02572a6b0
Gerrit-Change-Number: 35294
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Niewöhner
Gerrit-MessageType: newchange
Name of user not set #1002476 has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35311 )
Change subject: emulation/qemu-i440fx/northbridge.c: Fix minor whitespace
......................................................................
emulation/qemu-i440fx/northbridge.c: Fix minor whitespace
Change-Id: Ifc3825119c8463a7d17a5c162330f49612ae1b85
Signed-off-by: Himanshu Sahdev <himanshusah(a)hcl.com>
---
M src/mainboard/emulation/qemu-i440fx/northbridge.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/35311/1
diff --git a/src/mainboard/emulation/qemu-i440fx/northbridge.c b/src/mainboard/emulation/qemu-i440fx/northbridge.c
index 852800d..0bff4d7 100644
--- a/src/mainboard/emulation/qemu-i440fx/northbridge.c
+++ b/src/mainboard/emulation/qemu-i440fx/northbridge.c
@@ -72,7 +72,7 @@
for (i = 0; i < f.size / sizeof(*list); i++) {
switch (list[i].type) {
case 1: /* RAM */
- printk(BIOS_DEBUG, "QEMU: e820/ram: 0x%08llx +0x%08llx\n",
+ printk(BIOS_DEBUG, "QEMU: e820/ram: 0x%08llx + 0x%08llx\n",
list[i].address, list[i].length);
if (list[i].address == 0) {
tomk = list[i].length / 1024;
--
To view, visit https://review.coreboot.org/c/coreboot/+/35311
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ifc3825119c8463a7d17a5c162330f49612ae1b85
Gerrit-Change-Number: 35311
Gerrit-PatchSet: 1
Gerrit-Owner: Name of user not set #1002476
Gerrit-MessageType: newchange