Skip to content

Commit

Permalink
SBE Update: Don't alter HBB partition when customizing SBE image
Browse files Browse the repository at this point in the history
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/57480
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>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Nick Bofferding authored and dcrowell77 committed Apr 20, 2018
1 parent 502258b commit 6dc8fa9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/usr/sbe/sbe_update.C
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6dc8fa9

Please sign in to comment.