Skip to content

Commit

Permalink
Fix HTM trace setup problem
Browse files Browse the repository at this point in the history
- Allocate HTM/OCC memory location in order from largest -> smallest.
- Verify memory bar addresses aligned with memory allocation size.

Set #3: Address Joe's and Jenny's comments from set #2

Change-Id: I1000b3d6de371c129ae62ca53be36b632a1c545e
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82121
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Joseph J McGill <jmcgill@us.ibm.com>
Reviewed-by: Jenny Huynh <jhuynh@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82196
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: Christian R Geddes <crgeddes@us.ibm.com>
  • Loading branch information
ibmthi authored and crgeddes committed Aug 26, 2019
1 parent c796d2c commit bf2951c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
21 changes: 19 additions & 2 deletions src/import/chips/p9/procedures/hwp/nest/p9_mss_eff_grouping.C
Expand Up @@ -1553,7 +1553,8 @@ fapi2::ReturnCode EffGroupingBaseSizeData::set_HTM_OCC_base_addr(
}

// Setting NHTM & OCC base addresses
if ( (l_nhtmSize + l_chtmSize) < i_procAttrs.iv_occSandboxSize)
// Set larger allocations on top (at higher addresses)
if ( (l_nhtmSize + l_chtmSize) >= i_procAttrs.iv_occSandboxSize)
{
iv_occ_sandbox_base = l_mem_bases[l_index] + l_mem_sizes[l_index];
iv_nhtm_bar_base = iv_occ_sandbox_base + i_procAttrs.iv_occSandboxSize;
Expand All @@ -1564,6 +1565,22 @@ fapi2::ReturnCode EffGroupingBaseSizeData::set_HTM_OCC_base_addr(
iv_occ_sandbox_base = iv_nhtm_bar_base + l_nhtmSize + l_chtmSize;
}

// Verify NHTM base addresses aligned with allocated size.
// The OCC sandbox base is just a FW scratch area and no HW
// functions mapped to it so we don't need to check its base alignment.
if (iv_nhtm_bar_base & (l_nhtmSize + l_chtmSize - 1) )
{
FAPI_ASSERT(false,
fapi2::MSS_EFF_GROUPING_ADDRESS_NOT_ALIGNED()
.set_NHTM_BAR_BASE(iv_nhtm_bar_base)
.set_NHTM_SIZE(l_nhtmSize)
.set_CHTM_SIZE(l_chtmSize),
"EffGroupingBaseSizeData::set_HTM_OCC_base_addr: "
"NHTM BAR base address is not aligned with its size "
"NHTM_BAR_BASE 0x%.16llX, NHTM_SIZE 0x%.16llX, CTHM_SIZE 0x%.16llX",
iv_nhtm_bar_base, l_nhtmSize, l_chtmSize);
}

// Setting CHTM base addresses
for (uint8_t ii = 0; ii < NUM_OF_CHTM_REGIONS; ii++)
{
Expand Down Expand Up @@ -1839,7 +1856,7 @@ fapi2::ReturnCode EffGroupingBaseSizeData::setSMFBaseSizeData(
ii, l_mem_bases[ii], l_mem_sizes[ii]);
}

FAPI_INF("SMF_BASE %.16lld (%d GB)", iv_smf_bar_base, iv_smf_bar_base >> 30);
FAPI_INF("SMF_BASE 0x%.16llX", iv_smf_bar_base);

for (uint8_t ii = 0; ii < l_numRegions; ii++)
{
Expand Down
Expand Up @@ -5,7 +5,7 @@
<!-- -->
<!-- OpenPOWER HostBoot Project -->
<!-- -->
<!-- Contributors Listed Below - COPYRIGHT 2015,2018 -->
<!-- Contributors Listed Below - COPYRIGHT 2015,2019 -->
<!-- [+] International Business Machines Corp. -->
<!-- -->
<!-- -->
Expand Down Expand Up @@ -239,4 +239,18 @@
</callout>
</hwpError>

<hwpError>
<rc>RC_MSS_EFF_GROUPING_ADDRESS_NOT_ALIGNED</rc>
<description>
NHTM BAR address is not aligned with requested size.
</description>
<ffdc>NHTM_BAR_BASE</ffdc>
<ffdc>NHTM_SIZE</ffdc>
<ffdc>CHTM_SIZE</ffdc>
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
</callout>
</hwpError>

</hwpErrors>

0 comments on commit bf2951c

Please sign in to comment.