From 09661ceffcc087df516f7d74942976d3f181acd3 Mon Sep 17 00:00:00 2001 From: Claus Michael Olsen Date: Mon, 12 Feb 2018 14:24:33 -0600 Subject: Fix to TOR API failure on 32b systems 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 Tested-by: Jenkins Server Tested-by: HWSV CI Reviewed-by: Sachin Gupta Tested-by: PPE CI Tested-by: Cronus HW CI Tested-by: Hostboot CI Reviewed-by: Thi N. Tran Reviewed-by: Jennifer A. Stofer --- import/chips/p9/utils/imageProcs/p9_tor.C | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/import/chips/p9/utils/imageProcs/p9_tor.C b/import/chips/p9/utils/imageProcs/p9_tor.C index 769e6dad..7014beb3 100644 --- a/import/chips/p9/utils/imageProcs/p9_tor.C +++ b/import/chips/p9/utils/imageProcs/p9_tor.C @@ -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 ); @@ -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; } -- cgit v1.2.3