Skip to content

Commit

Permalink
Fix to TOR API failure on 32b systems
Browse files Browse the repository at this point in the history
This fixes a bug wrt incorrect use of sizeof() on a pointer
that only shows up on 32b system (but is luckily successful
on 64b systems).

Key_Cronus_Test=XIP_REGRESS

Change-Id: I9f33c5728cb68acaeee55580c9f1c1b8743cbd8d
CQ: SW412437
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53875
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Cronus HW CI <cronushw-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53904
  • Loading branch information
cmolsen authored and sgupta2m committed Feb 14, 2018
1 parent 615f07e commit 37930cd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/import/chips/p9/utils/imageProcs/p9_tor.C
Expand Up @@ -121,7 +121,7 @@ int get_ring_from_ring_section( void* i_ringSection, // Ring secti
//
// 1. Calc offset to TOR slot pointing to chiplet's COM or INST section
cpltOffset = sizeof(TorHeader_t) +
iCplt * sizeof(cpltBlock) +
iCplt * sizeof(TorCpltBlock_t) +
bInstCase * sizeof(cpltBlock->cmnOffset);
// 2. Retrive offset, endian convert and make it relative to ring section origin
cpltOffset = *(uint32_t*)( (uint8_t*)i_ringSection + cpltOffset );
Expand Down Expand Up @@ -226,6 +226,11 @@ int get_ring_from_ring_section( void* i_ringSection, // Ring secti
if (ringOffset)
{
MY_ERR("Ring container is already present in image\n");
MY_ERR(" Ring section addr: 0x%016lx (First 8B: 0x%016lx)\n",
(uintptr_t)i_ringSection,
be64toh(*((uint64_t*)i_ringSection)));
MY_ERR(" cpltOffset=0x%08x, torSlotNum=0x%x, TOR offset=0x%04x\n",
cpltOffset, torSlotNum, ringOffset);
return TOR_RING_AVAILABLE_IN_RINGSECTION;
}

Expand Down

0 comments on commit 37930cd

Please sign in to comment.