diff options
author | Dean Sanner <dsanner@us.ibm.com> | 2017-02-23 08:41:00 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-02-27 09:26:20 -0500 |
commit | ec0476878770d601b40cf75528fe07e5ab1beb53 (patch) | |
tree | 117253ba2bf799d307889e54ff235ebe68421bc7 /src/usr | |
parent | 2e7f87d72580caac7cfb3e96e80764a94b430df5 (diff) | |
download | talos-hostboot-ec0476878770d601b40cf75528fe07e5ab1beb53.tar.gz talos-hostboot-ec0476878770d601b40cf75528fe07e5ab1beb53.zip |
Reduce memory fragmentation during SBE updates
- Original code was repeatedly allocating/freeing 256K chunks of
heap memory
- Other tasks in the background fragmented the allocations and
could lead to out of memory conditions on large core number
parts
- Fix is to allocation one large chunk up front and use that for
all operations
Change-Id: Ie6df7eb9ebce526d87480425e842f8d1be8d78d4
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36920
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/sbe/sbe_update.C | 10 | ||||
-rw-r--r-- | src/usr/sbe/sbe_update.H | 12 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C index 0c97dd256..87703fdee 100644 --- a/src/usr/sbe/sbe_update.C +++ b/src/usr/sbe/sbe_update.C @@ -910,7 +910,7 @@ namespace SBE // Call p9_xip_delete_section to delete existing HBBL image // from SBE image - void *l_imageBuf = malloc(io_image_size); + void *l_imageBuf =malloc(io_image_size); xip_rc = p9_xip_delete_section( i_image, l_imageBuf, @@ -1149,13 +1149,12 @@ namespace SBE procIOMask = coreMask; uint32_t l_ringSectionBufSize = MAX_SEEPROM_IMAGE_SIZE; - void* l_ringSectionBuf = malloc(l_ringSectionBufSize); FAPI_INVOKE_HWP( err, p9_xip_customize, l_fapiTarg, io_imgPtr, //image in/out tmpImgSize, - l_ringSectionBuf, + (void*)RING_SEC_VADDR, l_ringSectionBufSize, SYSPHASE_HB_SBE, MODEBUILD_IPL, @@ -1164,7 +1163,6 @@ namespace SBE (void*)RING_BUF2_VADDR, (uint32_t)MAX_RING_BUF_SIZE, procIOMask ); // Bits(8:31) = EC00:EC23 - free(l_ringSectionBuf); // Check for no error and use of input cores if ( (NULL == err) && (procIOMask == coreMask)) @@ -1986,7 +1984,7 @@ namespace SBE static_cast<uint32_t>(sbePnorImageSize + hbblCachelineSize); // copy SBE image from PNOR to memory - sbeHbblImgPtr = malloc(sbeHbblImgSize); + sbeHbblImgPtr = (void*)SBE_HBBL_IMG_VADDR; memcpy ( sbeHbblImgPtr, sbePnorPtr, sbePnorImageSize); @@ -2128,8 +2126,6 @@ namespace SBE }while(0); - free(sbeHbblImgPtr); - return err; } diff --git a/src/usr/sbe/sbe_update.H b/src/usr/sbe/sbe_update.H index 7b86bd3b7..c228eed32 100644 --- a/src/usr/sbe/sbe_update.H +++ b/src/usr/sbe/sbe_update.H @@ -135,16 +135,26 @@ namespace SBE /******************************************/ /* Enums */ /******************************************/ + // SBE VADDR Layout + // 000K - 256K = Dest for Customized SBE image + // + // 256K - 316K = Ring buf1 + // 316K - 376K = Ring buf2 + // 376K - 632K = Ring Section buf + // ---- ALT use 256K-632K for SBE ECC image + // 632K - 888K = SBE + HBBL image enum { FIXED_SEEPROM_WORK_SPACE = 256 * 1024, SBE_IMG_VADDR = VMM_VADDR_SBE_UPDATE, RING_BUF1_VADDR = FIXED_SEEPROM_WORK_SPACE + SBE_IMG_VADDR, RING_BUF2_VADDR = RING_BUF1_VADDR + MAX_RING_BUF_SIZE, + RING_SEC_VADDR = RING_BUF2_VADDR + MAX_RING_BUF_SIZE, //NOTE: recycling the same memory space for different //steps in the process. - SBE_ECC_IMG_VADDR = VMM_VADDR_SBE_UPDATE + (VMM_SBE_UPDATE_SIZE / 2), + SBE_ECC_IMG_VADDR = RING_BUF1_VADDR, SBE_ECC_IMG_MAX_SIZE = (MAX_SEEPROM_IMAGE_SIZE * 9 / 8) + (3 * SBE_SEEPROM_ECC_PAD), + SBE_HBBL_IMG_VADDR = RING_SEC_VADDR + FIXED_SEEPROM_WORK_SPACE, }; // Used for MVPD function |