summaryrefslogtreecommitdiffstats
path: root/src/kernel
diff options
context:
space:
mode:
authorNick Bofferding <bofferdn@us.ibm.com>2019-04-05 17:27:34 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-04-08 13:19:46 -0500
commita9aa7be26b1f54c228377ffa99c4afd3947b12dd (patch)
tree001b9f08874d1b155d098ff75e4b55ee97adcebd /src/kernel
parentecf2201cee8cdd3e6eca7d56897fbdf108e59bf5 (diff)
downloadtalos-hostboot-a9aa7be26b1f54c228377ffa99c4afd3947b12dd.tar.gz
talos-hostboot-a9aa7be26b1f54c228377ffa99c4afd3947b12dd.zip
Fix page coalesce bug in coalescing end of cache memory range
Fixes a page coalesce bug where the page coalesce routine failed to factor in the actual start address of the range, and therefore could not coalesce pages back together correctly. Additionally, decreases the amount of space reserved for the OCC bootloader from an inadvertent 32k to 4k as intended. Change-Id: Iffd35560d67f6b2f27daf6dca3dc45a900fb4335 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75636 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> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/misc.C20
-rw-r--r--src/kernel/pagemgr.C14
2 files changed, 23 insertions, 11 deletions
diff --git a/src/kernel/misc.C b/src/kernel/misc.C
index 918c17aba..7d19131ef 100644
--- a/src/kernel/misc.C
+++ b/src/kernel/misc.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2018 */
+/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -512,8 +512,8 @@ namespace KernelMisc
return -EFAULT;
}
- uint64_t* startAddr = NULL;
- uint64_t* endAddr = NULL;
+ uint8_t* startAddr = nullptr;
+ uint8_t* endAddr = nullptr;
switch(CpuID::getCpuType())
{
@@ -523,9 +523,9 @@ namespace KernelMisc
case CORE_POWER9_NIMBUS:
case CORE_POWER9_CUMULUS:
case CORE_POWER9_AXONE:
- startAddr = reinterpret_cast<uint64_t*>
- ( VmmManager::INITIAL_MEM_SIZE ) ;
- endAddr = reinterpret_cast<uint64_t*>(i_expandSize);
+ startAddr = reinterpret_cast<uint8_t*>
+ (VmmManager::INITIAL_MEM_SIZE);
+ endAddr = reinterpret_cast<uint8_t*>(i_expandSize);
break;
default:
@@ -533,13 +533,15 @@ namespace KernelMisc
break;
}
- if (startAddr != NULL)
+ if (startAddr != nullptr)
{
- populate_cache_lines(startAddr, endAddr);
+ populate_cache_lines(
+ reinterpret_cast<uint64_t*>(startAddr),
+ reinterpret_cast<uint64_t*>(endAddr));
// Increment the start address by a page size to make a gap
// in memory that Hostboot will later populate with
// the OCC Bootloader image.
- // see src/usr/occ/occ.C::loadnStartAllOccs()
+ // see src/usr/isteps/pm/occCheckstop.C::loadOCCImageDuringIpl()
startAddr += PAGESIZE;
size_t pages = (reinterpret_cast<uint64_t>(endAddr) -
reinterpret_cast<uint64_t>(startAddr)) / PAGESIZE;
diff --git a/src/kernel/pagemgr.C b/src/kernel/pagemgr.C
index 3b5966421..bb2cf7581 100644
--- a/src/kernel/pagemgr.C
+++ b/src/kernel/pagemgr.C
@@ -434,7 +434,9 @@ void PageManagerCore::coalesce( void )
// To determine this, get the index of the block as if the whole
// page memory space were blocks of this size. Note: have to
// take into account the page manager "hole" in the middle of the
- // space
+ // initial memory allocation. Also have to ignore the OCC
+ // bootloader page at the start of the third memory range which
+ // accounts for the rest of the cache.
uint64_t p_idx = 0;
if(reinterpret_cast<uint64_t>(p) < VmmManager::pageTableOffset())
{
@@ -442,13 +444,21 @@ void PageManagerCore::coalesce( void )
- VmmManager::endPreservedOffset())/
((1 << bucket)*PAGESIZE);
}
- else
+ else if( reinterpret_cast<uint64_t>(p)
+ < VmmManager::INITIAL_MEM_SIZE)
{
p_idx = ( reinterpret_cast<uint64_t>(p)
- ( VmmManager::pageTableOffset()
+ VmmManager::PTSIZE) )/
((1 << bucket)*PAGESIZE);
}
+ else
+ {
+ p_idx = ( reinterpret_cast<uint64_t>(p)
+ - ( VmmManager::INITIAL_MEM_SIZE
+ + PAGESIZE) )/
+ ((1 << bucket)*PAGESIZE);
+ }
if(0 != (p_idx % 2)) // odd index
{
OpenPOWER on IntegriCloud