summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Bofferding <bofferdn@us.ibm.com>2018-04-18 22:13:49 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-04-19 14:43:07 -0400
commita600e574610742073727851ab1d04de85e1b5429 (patch)
tree40853bda1e67e2c66336c9f16431a7f516903b92
parenta322b3d7b9bf9f41192ee757fa78f55816da9a71 (diff)
downloadtalos-hostboot-a600e574610742073727851ab1d04de85e1b5429.tar.gz
talos-hostboot-a600e574610742073727851ab1d04de85e1b5429.zip
SBE Update: Don't alter HBB partition when customizing SBE image
This change creates a scratch copy of the HBBL (bootloader) partition during SBE image customization because the data is potentially altered prior to customizing it into the SBE image. If the partition data is altered directly, that can trigger a storage exception when HBBL's memory pages are read only. Change-Id: I00f220170c69401d4dcefd294e96aacccc7baff8 Resolves: #133 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57442 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> CI-Ready: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com> Reviewed-by: Marshall J. Wilks <mjwilks@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/usr/sbe/sbe_update.C10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C
index cf27fac16..4cdb67d1c 100644
--- a/src/usr/sbe/sbe_update.C
+++ b/src/usr/sbe/sbe_update.C
@@ -2078,8 +2078,14 @@ namespace SBE
err->reasonCode() );
break;
}
- const void* hbblPnorPtr = reinterpret_cast<const void*>(
- pnorInfo.vaddr);
+
+ // Create a working copy of HBBL since it may need to be modified
+ // and it's not legal to update code partitions
+ uint8_t pHbbl[MAX_HBBL_SIZE]={0};
+ memcpy(pHbbl,
+ reinterpret_cast<const void*>(pnorInfo.vaddr),
+ sizeof(pHbbl));
+ const void* hbblPnorPtr = reinterpret_cast<const void*>(pHbbl);
// Use max hbbl size and not the PNOR size. The PNOR size can grow
// to add a secure header, but the code size limit is still 20K.
OpenPOWER on IntegriCloud