diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/kernel/misc.C | 20 | ||||
-rw-r--r-- | src/kernel/pagemgr.C | 14 |
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 { |