HAOUAS Elyes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41129 )
Change subject: sb/intel/i82371eb: Replace GPLv2 long form headers with SPDX header
......................................................................
sb/intel/i82371eb: Replace GPLv2 long form headers with SPDX header
Change-Id: If54234ec2d80d5a6502400eb1c6f02dd9bba73c5
Signed-off-by: Elyes HAOUAS <ehaouas(a)noos.fr>
---
M src/southbridge/intel/i82371eb/fadt.c
1 file changed, 2 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/29/41129/1
diff --git a/src/southbridge/intel/i82371eb/fadt.c b/src/southbridge/intel/i82371eb/fadt.c
index 3240221..77801e4 100644
--- a/src/southbridge/intel/i82371eb/fadt.c
+++ b/src/southbridge/intel/i82371eb/fadt.c
@@ -1,17 +1,8 @@
/* This file is part of the coreboot project. */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
/*
* Based on src/southbridge/via/vt8237r/vt8237_fadt.c
- *
- *
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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 <string.h>
--
To view, visit https://review.coreboot.org/c/coreboot/+/41129
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If54234ec2d80d5a6502400eb1c6f02dd9bba73c5
Gerrit-Change-Number: 41129
Gerrit-PatchSet: 1
Gerrit-Owner: HAOUAS Elyes <ehaouas(a)noos.fr>
Gerrit-MessageType: newchange
Keith Hui has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41094 )
Change subject: sb/intel/i82371eb: Fix iasl warning
......................................................................
sb/intel/i82371eb: Fix iasl warning
The backslash on the very last line is not needed and causes an iasl
warning.
Change-Id: I27e78bc34b9386dd014db5880a104693b4f0db5a
Signed-off-by: Keith Hui <buurin(a)gmail.com>
---
M src/southbridge/intel/i82371eb/acpi/intx.asl
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/41094/1
diff --git a/src/southbridge/intel/i82371eb/acpi/intx.asl b/src/southbridge/intel/i82371eb/acpi/intx.asl
index c1dc508..fe2c180 100644
--- a/src/southbridge/intel/i82371eb/acpi/intx.asl
+++ b/src/southbridge/intel/i82371eb/acpi/intx.asl
@@ -45,4 +45,4 @@
} \
Store(Local0, pinx) \
} \
-} \
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/41094
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I27e78bc34b9386dd014db5880a104693b4f0db5a
Gerrit-Change-Number: 41094
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Hui <buurin(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Hello Vadim Bendebury, Andrey Pronin,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/41100
to review the following change.
Change subject: security: tcg-2.0: Improve error response handling, fix Cr50 boot mode
......................................................................
security: tcg-2.0: Improve error response handling, fix Cr50 boot mode
This patch imrpoves the response buffer handling for some TPM 2.0
commands in error cases. Previously we would just allow any command to
return no payload -- with this patch, only commands with errors are
accepted without payload as a default, for other commands the
command-specific unmarshalling code decides the expected response
length. Also explicitly confirm that the amount of data received matches
the response header. For vendor commands, we additionally allow errors
to have an empty payload after the subcommand code.
This fixes a problem with the Cr50 GET_BOOT_MODE command where an error
response would only return the subcommand code but no data after that.
Also add support for a second, slightly different NO_SUCH_COMMAND error
code that was added in Cr50 recently.
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: Ib85032d85482d5484180be6fd105f2467f393cd2
---
M src/security/tpm/tss/tcg-2.0/tss_marshaling.c
M src/security/tpm/tss/vendor/cr50/cr50.c
M src/security/tpm/tss/vendor/cr50/cr50.h
3 files changed, 29 insertions(+), 18 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/00/41100/1
diff --git a/src/security/tpm/tss/tcg-2.0/tss_marshaling.c b/src/security/tpm/tss/tcg-2.0/tss_marshaling.c
index a229dd1..ce0ee5e 100644
--- a/src/security/tpm/tss/tcg-2.0/tss_marshaling.c
+++ b/src/security/tpm/tss/tcg-2.0/tss_marshaling.c
@@ -546,29 +546,33 @@
return 0;
}
-static int unmarshal_vendor_command(struct ibuf *ib,
- struct vendor_command_response *vcr)
+static int unmarshal_vendor_command(struct ibuf *ib, struct tpm2_response *resp)
{
- if (ibuf_read_be16(ib, &vcr->vc_subcommand))
+ if (ibuf_read_be16(ib, &resp->vcr.vc_subcommand))
return -1;
- switch (vcr->vc_subcommand) {
+ /* On errors, some subcommands do not return a payload. */
+ if (resp->hdr.tpm_code != TPM2_RC_SUCCESS &&
+ ibuf_nr_read(ib) == resp->hdr.tpm_size)
+ return 0;
+
+ switch (resp->vcr.vc_subcommand) {
case TPM2_CR50_SUB_CMD_IMMEDIATE_RESET:
break;
case TPM2_CR50_SUB_CMD_NVMEM_ENABLE_COMMITS:
break;
case TPM2_CR50_SUB_CMD_TURN_UPDATE_ON:
- return ibuf_read_be8(ib, &vcr->num_restored_headers);
+ return ibuf_read_be8(ib, &resp->vcr.num_restored_headers);
case TPM2_CR50_SUB_CMD_GET_REC_BTN:
- return ibuf_read_be8(ib, &vcr->recovery_button_state);
+ return ibuf_read_be8(ib, &resp->vcr.recovery_button_state);
case TPM2_CR50_SUB_CMD_TPM_MODE:
- return ibuf_read_be8(ib, &vcr->tpm_mode);
+ return ibuf_read_be8(ib, &resp->vcr.tpm_mode);
case TPM2_CR50_SUB_CMD_GET_BOOT_MODE:
- return ibuf_read_be8(ib, &vcr->boot_mode);
+ return ibuf_read_be8(ib, &resp->vcr.boot_mode);
default:
printk(BIOS_ERR,
"%s:%d - unsupported vendor command %#04x!\n",
- __func__, __LINE__, vcr->vc_subcommand);
+ __func__, __LINE__, resp->vcr.vc_subcommand);
return -1;
}
@@ -587,14 +591,18 @@
if (rc != 0)
return NULL;
- if (ibuf_remaining(ib) == 0) {
- if (tpm2_static_resp.hdr.tpm_size != ibuf_nr_read(ib))
- printk(BIOS_ERR,
- "%s: size mismatch in response to command %#x\n",
- __func__, command);
- return &tpm2_static_resp;
+ if (ibuf_remaining(ib) != tpm2_static_resp.hdr.tpm_size - 10) {
+ printk(BIOS_ERR,
+ "%s: size mismatch in response to command %#x\n",
+ __func__, command);
+ return NULL;
}
+ /* On errors, some commands do not return a payload. */
+ if (tpm2_static_resp.hdr.tpm_code != TPM2_RC_SUCCESS &&
+ ibuf_remaining(ib) == 0)
+ return &tpm2_static_resp;
+
switch (command) {
case TPM2_Startup:
case TPM2_Shutdown:
@@ -620,7 +628,7 @@
break;
case TPM2_CR50_VENDOR_COMMAND:
- rc |= unmarshal_vendor_command(ib, &tpm2_static_resp.vcr);
+ rc |= unmarshal_vendor_command(ib, &tpm2_static_resp);
break;
default:
diff --git a/src/security/tpm/tss/vendor/cr50/cr50.c b/src/security/tpm/tss/vendor/cr50/cr50.c
index ae2f7c2..d7bf48d 100644
--- a/src/security/tpm/tss/vendor/cr50/cr50.c
+++ b/src/security/tpm/tss/vendor/cr50/cr50.c
@@ -89,7 +89,8 @@
return TPM_E_MUST_REBOOT;
}
- if (response->hdr.tpm_code == VENDOR_RC_NO_SUCH_COMMAND) {
+ if (response->hdr.tpm_code == VENDOR_RC_NO_SUCH_COMMAND ||
+ response->hdr.tpm_code == VENDOR_RC_NO_SUCH_SUBCOMMAND) {
/*
* Explicitly inform caller when command is not supported
*/
@@ -119,7 +120,8 @@
if (!response)
return TPM_E_IOERROR;
- if (response->hdr.tpm_code == VENDOR_RC_NO_SUCH_COMMAND)
+ if (response->hdr.tpm_code == VENDOR_RC_NO_SUCH_COMMAND ||
+ response->hdr.tpm_code == VENDOR_RC_NO_SUCH_SUBCOMMAND)
/* Explicitly inform caller when command is not supported */
return TPM_E_NO_SUCH_COMMAND;
diff --git a/src/security/tpm/tss/vendor/cr50/cr50.h b/src/security/tpm/tss/vendor/cr50/cr50.h
index 0f91732..e3146a4 100644
--- a/src/security/tpm/tss/vendor/cr50/cr50.h
+++ b/src/security/tpm/tss/vendor/cr50/cr50.h
@@ -21,6 +21,7 @@
#define VENDOR_RC_ERR 0x00000500
enum cr50_vendor_rc {
VENDOR_RC_INTERNAL_ERROR = (VENDOR_RC_ERR | 6),
+ VENDOR_RC_NO_SUCH_SUBCOMMAND = (VENDOR_RC_ERR | 8),
VENDOR_RC_NO_SUCH_COMMAND = (VENDOR_RC_ERR | 127),
};
--
To view, visit https://review.coreboot.org/c/coreboot/+/41100
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib85032d85482d5484180be6fd105f2467f393cd2
Gerrit-Change-Number: 41100
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Andrey Pronin <apronin(a)chromium.org>
Gerrit-Reviewer: Vadim Bendebury <vbendeb(a)chromium.org>
Gerrit-MessageType: newchange
Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41104 )
Change subject: memrange: Break early from memranges_find_entry if limit is crossed
......................................................................
memrange: Break early from memranges_find_entry if limit is crossed
This change updates memranges_find_entry() to break and return early
if the end address of the hole within the current range entry crosses
the requested limit. This is because all range entries and maintained
in increasing order and so none of the following range entries can
satisfy the given request.
Change-Id: I14e03946ddbbb5d254b23e9a9917da42960313a6
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
---
M src/lib/memrange.c
1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/41104/1
diff --git a/src/lib/memrange.c b/src/lib/memrange.c
index 32f053d..bc827d3 100644
--- a/src/lib/memrange.c
+++ b/src/lib/memrange.c
@@ -400,8 +400,13 @@
if (end > r->end)
continue;
+ /*
+ * If end for the hole in the current range entry goes beyond the requested
+ * limit, then none of the following ranges can satisfy this request because all
+ * range entries are maintained in increasing order.
+ */
if (end > limit)
- continue;
+ break;
return r;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/41104
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I14e03946ddbbb5d254b23e9a9917da42960313a6
Gerrit-Change-Number: 41104
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan(a)google.com>
Gerrit-MessageType: newchange
Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41103 )
Change subject: memrange: Update comment to indicate limit is inclusive for memranges_next_entry
......................................................................
memrange: Update comment to indicate limit is inclusive for memranges_next_entry
This change updates the comment for memranges_next_entry() to indicate
that the limit provided by the caller is inclusive.
Change-Id: Id40263efcb9417ed31c130996e56c30dbbc82e02
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
---
M src/include/memrange.h
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/41103/1
diff --git a/src/include/memrange.h b/src/include/memrange.h
index 2579f20..faeef2e 100644
--- a/src/include/memrange.h
+++ b/src/include/memrange.h
@@ -162,7 +162,7 @@
const struct range_entry *r);
/* Steals memory from the available list in given ranges as per the constraints:
- * limit = Upper bound for the memory range to steal.
+ * limit = Upper bound for the memory range to steal (Inclusive).
* size = Requested size for the stolen memory.
* align = Required alignment(log 2) for the starting address of the stolen memory.
* tag = Use a range that matches the given tag.
--
To view, visit https://review.coreboot.org/c/coreboot/+/41103
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id40263efcb9417ed31c130996e56c30dbbc82e02
Gerrit-Change-Number: 41103
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan(a)google.com>
Gerrit-MessageType: newchange