Paul Menzel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38721 )
Change subject: Documentation: Mark up register names as code
......................................................................
Documentation: Mark up register names as code
Change-Id: I708385bca8edcd74b0d4c0a3ecc181b6ccd30c2b
Signed-off-by: Paul Menzel <pmenzel(a)molgen.mpg.de>
---
M Documentation/mainboard/lenovo/ivb_internal_flashing.md
1 file changed, 15 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/21/38721/1
diff --git a/Documentation/mainboard/lenovo/ivb_internal_flashing.md b/Documentation/mainboard/lenovo/ivb_internal_flashing.md
index 355cf98..e6b597b 100644
--- a/Documentation/mainboard/lenovo/ivb_internal_flashing.md
+++ b/Documentation/mainboard/lenovo/ivb_internal_flashing.md
@@ -5,9 +5,9 @@
Old versions of stock BIOS for these models have several security issues.
In order to flash coreboot internally, two of them are of interest.
-**First** is the fact the SMM_BWP and BLE are not enabled in BIOS
+**First** is the fact the `SMM_BWP` and `BLE` are not enabled in BIOS
versions released before 2014. We have tested many versions on T430 and
-X230 and found out that SMM_BWP=1 only since the update, the changelog
+X230 and found out that `SMM_BWP=1` only since the update, the changelog
of which contains following line:
> (New) Improved the UEFI BIOS security feature.
@@ -159,14 +159,14 @@
Configuration Registers. When set to 1, PR0-PR4 registers cannot be
written. Once set to 1, cannot be changed anymore.
-To be able to flash, we need SMM_BWP=0, BIOSWE=1, BLE=0, FLOCKDN=0 or
+To be able to flash, we need `SMM_BWP=0`, `BIOSWE=1`, `BLE=0`, `FLOCKDN=0` or
SPI protected ranges (PRx) to have a WP bit set to 0.
-Let's see what we have. Examine HSFS register:
+Let's see what we have. Examine `HSFS` register:
sudo chipsec_main -m chipsec.modules.common.spi_lock
-You should see that FLOCKDN=1:
+You should see that `FLOCKDN=1`:
[x][ =======================================================================
[x][ Module: SPI Flash Controller Configuration Locks
@@ -181,11 +181,11 @@
[14] FDV = 1 << Flash Descriptor Valid
[15] FLOCKDN = 1 << Flash Configuration Lock-Down
-Then check BIOS_CNTL and PR0-PR4:
+Then check `BIOS_CNTL` and PR0-PR4:
sudo chipsec_main -m common.bios_wp
-Good news: on old BIOS versions, SMM_BWP=0 and BLE=0.
+Good news: on old BIOS versions, `SMM_BWP=0` and `BLE=0`.
Bad news: there are 4 write protected SPI ranges:
@@ -215,8 +215,8 @@
sudo chipsec_util mmio dump SPIBAR
-You will see SPIBAR address (0xFED1F800) and registers (for example,
-00000004 is HSFS):
+You will see `SPIBAR` address (0xFED1F800) and registers (for example,
+`00000004` is `HSFS`):
[mmio] MMIO register range [0x00000000FED1F800:0x00000000FED1F800+00000200]:
+00000000: 0BFF0500
@@ -224,11 +224,11 @@
...
As you can see, the only thing we need is to unset WP bit on PR0-PR4.
-But that cannot be done once FLOCKDN is set to 1.
+But that cannot be done once `FLOCKDN` is set to 1.
Now the fun part!
-FLOCKDN may only be cleared by a hardware reset, which includes S3
+`FLOCKDN` may only be cleared by a hardware reset, which includes S3
state. On S3 resume boot path, the chipset configuration has to be
restored and it's done by executing so-called S3 Boot Scripts. You can
dump these scripts by executing:
@@ -236,7 +236,7 @@
sudo chipsec_util uefi s3bootscript
There are many entries. Along them, you can find instructions to write
-to HSFS (remember, we know that SPIBAR is 0xFED1F800):
+to `HSFS` (remember, we know that `SPIBAR` is 0xFED1F800):
Entry at offset 0x2B8F (len = 0x17, header len = 0x0):
Data:
@@ -251,7 +251,7 @@
These scripts are stored in memory. The vulnerability is that we can
overwrite this memory, change these instructions and they will be
-executed on S3 resume. Once we patch that instruction to not set FLOCKDN
+executed on S3 resume. Once we patch that instruction to not set `FLOCKDN`
bit, we will be able to write to PR0-PR4 registers.
## Creating a backup
@@ -274,7 +274,7 @@
## Removing protections (practice)
-The original boot script writes 0xE009 to HSFS. FLOCKDN is 15th bit, so
+The original boot script writes 0xE009 to `HSFS`. `FLOCKDN` is 15th bit, so
let's write 0x6009 instead:
sudo chipsec_main -m tools.uefi.s3script_modify -a replace_op,mmio_wr,0xFED1F804,0x6009,0x2
@@ -297,7 +297,7 @@
[*] After sleep/resume, check the value of register 0xFED1F804 is 0x6009
[+] PASSED: The script has been modified. Go to sleep..
-Now go to S3, then resume and check FLOCKDN. It should be 0:
+Now go to S3, then resume and check `FLOCKDN`. It should be 0:
sudo chipsec_main -m chipsec.modules.common.spi_lock
--
To view, visit https://review.coreboot.org/c/coreboot/+/38721
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I708385bca8edcd74b0d4c0a3ecc181b6ccd30c2b
Gerrit-Change-Number: 38721
Gerrit-PatchSet: 1
Gerrit-Owner: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newchange
Marcello Sylvester Bauer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38711 )
Change subject: util/ifdtool: Support modification of single Flash Descriptor
......................................................................
util/ifdtool: Support modification of single Flash Descriptor
Add the capability to update the Flash Descriptor module directly
instead of raising a Segmentation Fault.
In this way it will be possible to add a Kconfig options to modify the
ifd descriptor at build-time.
Change-Id: Id3db09291af2bd2e759c283e316afd5da1fb4ca7
Signed-off-by: Marcello Sylvester Bauer <sylv(a)sylv.io>
---
M util/ifdtool/ifdtool.c
1 file changed, 23 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/38711/1
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c
index 0b6b210..fa2a564 100644
--- a/util/ifdtool/ifdtool.c
+++ b/util/ifdtool/ifdtool.c
@@ -1263,6 +1263,7 @@
region_t new_regions[MAX_REGIONS];
int new_extent = 0;
char *new_image;
+ bool descriptor_only;
/* load current descriptor map and regions */
frba_t *frba = find_frba(image, size);
@@ -1336,8 +1337,17 @@
new_extent = new_regions[i].limit;
}
+ /* check if the image is actually a Flash Descriptor module */
+ descriptor_only = false;
+ /* compare image size to descriptor */
+ if (size == new_regions[0].size) {
+ printf("The image is a single Flash Descriptor module:\n");
+ printf(" Only the module will be modified\n");
+ descriptor_only = true;
+ }
+
new_extent = next_pow2(new_extent - 1);
- if (new_extent != size) {
+ if (!descriptor_only && new_extent != size) {
printf("The image has changed in size.\n");
printf("The old image is %d bytes.\n", size);
printf("The new image is %d bytes.\n", new_extent);
@@ -1367,6 +1377,12 @@
offset_current = current->size - new->size;
}
+ if (size < current->base + offset_current + copy_size) {
+ printf("Skip Descriptor %d (%s) (region missing in the old image)\n", i,
+ region_name(i));
+ continue;
+ };
+
printf("Copy Descriptor %d (%s) (%d bytes)\n", i,
region_name(i), copy_size);
printf(" from %08x+%08x:%08x (%10d)\n", current->base,
@@ -1384,10 +1400,15 @@
if (!frba)
exit(EXIT_FAILURE);
+ printf("Modify Flash Descriptor regions\n");
for (i = 1; i < max_regions; i++)
set_region(frba, i, &new_regions[i]);
- write_image(filename, new_image, new_extent);
+ if (descriptor_only) {
+ write_image(filename, new_image, size);
+ } else {
+ write_image(filename, new_image, new_extent);
+ };
free(new_image);
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/38711
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id3db09291af2bd2e759c283e316afd5da1fb4ca7
Gerrit-Change-Number: 38711
Gerrit-PatchSet: 1
Gerrit-Owner: Marcello Sylvester Bauer <sylv(a)sylv.io>
Gerrit-MessageType: newchange
Sridhar Siricilla has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38480 )
Change subject: soc/intel/common: Add description to HMRFPO status
......................................................................
soc/intel/common: Add description to HMRFPO status
Below changes are implemented:
1. Fix typos.
2. Rename 'padding' field of hmrfpo_get_status_resp struct to
'reserved' to match with ME BWG Guide.
3. Add documentation for HMRFPO Status.
TEST=Build and boot hatch
Change-Id: I4db9bdf7386c48e17ed0373cf334ccff358d1951
Signed-off-by: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
---
M src/soc/intel/common/block/cse/cse.c
M src/soc/intel/common/block/include/intelblocks/cse.h
2 files changed, 10 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/38480/1
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c
index 978f44f..5873d70 100644
--- a/src/soc/intel/common/block/cse/cse.c
+++ b/src/soc/intel/common/block/cse/cse.c
@@ -690,7 +690,7 @@
/*
* Sends HMRFPO Get Status command to CSE to get the HMRFPO status.
- * The status can be DISABLES/LOCKED/ENABLED
+ * The status can be DISABLED/LOCKED/ENABLED
*/
int cse_hmrfpo_get_status(void)
{
@@ -701,7 +701,7 @@
struct hmrfpo_get_status_resp {
struct mkhi_hdr hdr;
uint8_t status;
- uint8_t padding[3];
+ uint8_t reserved[3];
} __packed;
struct hmrfpo_get_status_msg msg = {
diff --git a/src/soc/intel/common/block/include/intelblocks/cse.h b/src/soc/intel/common/block/include/intelblocks/cse.h
index 6233f7d..1377bd4 100644
--- a/src/soc/intel/common/block/include/intelblocks/cse.h
+++ b/src/soc/intel/common/block/include/intelblocks/cse.h
@@ -144,8 +144,16 @@
#define CSE_RESET_ONLY 3
/* HMRFPO Status types */
+/* Host can't access ME region */
#define MKHI_HMRFPO_DISABLED 0
+
+/*
+ * ME Firmware locked down HMRFPO Feature.
+ * Host can't access ME region.
+ */
#define MKHI_HMRFPO_LOCKED 1
+
+/* Host can access ME region */
#define MKHI_HMRFPO_ENABLED 2
/*
--
To view, visit https://review.coreboot.org/c/coreboot/+/38480
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4db9bdf7386c48e17ed0373cf334ccff358d1951
Gerrit-Change-Number: 38480
Gerrit-PatchSet: 1
Gerrit-Owner: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-MessageType: newchange
Hello Kyösti Mälkki, Aaron Durbin, Arthur Heymans, cedarhouse1(a)comcast.net,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/38763
to review the following change.
Change subject: cpu/x86/smm: Add overflow check
......................................................................
cpu/x86/smm: Add overflow check
Rather bail out than run into undefined behavior.
Change-Id: Ife26a0abed0ce6bcafe1e7cd8f499618631c4df4
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M src/cpu/x86/smm/smm_module_loader.c
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/38763/1
diff --git a/src/cpu/x86/smm/smm_module_loader.c b/src/cpu/x86/smm/smm_module_loader.c
index a421436..81020a4 100644
--- a/src/cpu/x86/smm/smm_module_loader.c
+++ b/src/cpu/x86/smm/smm_module_loader.c
@@ -202,6 +202,8 @@
/* Adjust remaining size to account for save state. */
total_save_state_size = params->per_cpu_save_state_size *
params->num_concurrent_save_states;
+ if (total_save_state_size > size)
+ return -1;
size -= total_save_state_size;
/* The save state size encroached over the first SMM entry point. */
--
To view, visit https://review.coreboot.org/c/coreboot/+/38763
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ife26a0abed0ce6bcafe1e7cd8f499618631c4df4
Gerrit-Change-Number: 38763
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: cedarhouse1(a)comcast.net
Gerrit-MessageType: newchange
Hello Patrick Rudolph, Subrata Banik, Balaji Manigandan, Aamir Bohra, Sridhar Siricilla, Rizwan Qureshi, build bot (Jenkins), Furquan Shaikh, Patrick Georgi, V Sowmya, Nico Huber, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35402
to look at the new patch set (#61).
Change subject: soc/intel/common/block/cse: Add boot partition related APIs
......................................................................
soc/intel/common/block/cse: Add boot partition related APIs
The CSE region is logically divided into 3 boot partitions when
redundancy is enabled. These boot partitions are represented by BP1,
BP2 and BP3. In chrome platforms, CSE can boot from either BP1 or BP2.
The CSE image layout appears as below..
------------- -------------------- --------------------------
|CSE REGION | => | RO | RW | DATA | => | BP1 | BP2 + BP3 | DATA |
------------- -------------------- --------------------------
In order to support CSE FW update to RW region, below APIs help coreboot
to get info about the boot partitions, and allows coreboot to set CSE
to boot from required boot partition (either BP1(RO) or BP2).
GET_BOOT_PARTITION_INFO - provides info on available partitions in the CSE
region. The API provides info on boot partitions like start/end offsets
of a partition within CSE region, and their version and partition status.
SET_BOOT_PARTITION_INFO - Sets next boot partition to boot for CSE.
With the HECI API, firmware can notify CSE to boot from BP1 or BP2 on next
boot.
BUG=b:145809764
Change-Id: Iaa62409c0616d5913d21374a8a6804f82258eb4f
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Signed-off-by: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
---
M src/soc/intel/common/block/cse/Makefile.inc
A src/soc/intel/common/block/cse/cse_bp.c
M src/soc/intel/common/block/include/intelblocks/cse.h
3 files changed, 505 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/35402/61
--
To view, visit https://review.coreboot.org/c/coreboot/+/35402
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iaa62409c0616d5913d21374a8a6804f82258eb4f
Gerrit-Change-Number: 35402
Gerrit-PatchSet: 61
Gerrit-Owner: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Aamir Bohra <aamir.bohra(a)intel.com>
Gerrit-Reviewer: Balaji Manigandan <balaji.manigandan(a)intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Sridhar Siricilla <sridhar.siricilla(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: V Sowmya <v.sowmya(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Andrey Petrov <anpetrov(a)fb.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newpatchset