summaryrefslogtreecommitdiffstats
path: root/src/kernel/pagemgr.C
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/pagemgr.C
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/pagemgr.C')
-rw-r--r--src/kernel/pagemgr.C14
1 files changed, 12 insertions, 2 deletions
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