From 0f4bb93bb0255db58725cac3979c58784d2563f3 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Sun, 2 Jun 2013 15:04:18 -0500 Subject: Move mbox DMA buffer to unsecure memory. RTC: 64763 Change-Id: Ie910a57ca96bc6fc673097dbaf72e7df469b2017 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4803 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell Reviewed-by: Douglas R. Gilbert Reviewed-by: A. Patrick Williams III --- src/kernel/pagemgr.C | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'src/kernel') diff --git a/src/kernel/pagemgr.C b/src/kernel/pagemgr.C index c402c51bb..3c05fc6ab 100644 --- a/src/kernel/pagemgr.C +++ b/src/kernel/pagemgr.C @@ -211,11 +211,6 @@ void PageManager::_initialize() uint64_t endBlock = ALIGN_MEGABYTE_DOWN(currentBlock) + 512*KILOBYTE; - // Populate L3 cache lines for this chunk. - KernelMisc::populate_cache_lines( - reinterpret_cast(currentBlock), - reinterpret_cast(endBlock)); - // Adjust address to compensate for reserved hole and add to // heap... @@ -246,16 +241,27 @@ void PageManager::_initialize() // Hole is in the middle... yuck. else { - uint64_t pages = - (VmmManager::FIRST_RESERVED_PAGE - currentBlock) / PAGESIZE; + uint64_t hole_end = + (VmmManager::FIRST_RESERVED_PAGE - currentBlock); + + // Populate L3 for the first part of the chunk. + KernelMisc::populate_cache_lines( + reinterpret_cast(currentBlock), + reinterpret_cast(hole_end)); - iv_heap.addMemory(currentBlock, pages); - totalPages += pages; + // Add it to the heap. + iv_heap.addMemory(currentBlock, hole_end / PAGESIZE); + totalPages += (hole_end / PAGESIZE); currentBlock = VmmManager::END_RESERVED_PAGE; } } + // Populate L3 cache lines for this chunk. + KernelMisc::populate_cache_lines( + reinterpret_cast(currentBlock), + reinterpret_cast(endBlock)); + uint64_t pages = (endBlock - currentBlock) / PAGESIZE; iv_heap.addMemory(currentBlock, pages); @@ -265,6 +271,12 @@ void PageManager::_initialize() } while (reinterpret_cast(currentBlock) != endAddr); + // Ensure HW page table area is erased / populated. + KernelMisc::populate_cache_lines( + reinterpret_cast(VmmManager::INITIAL_PT_OFFSET), + reinterpret_cast(VmmManager::INITIAL_PT_OFFSET + + VmmManager::PTSIZE)); + printk("%ld pages.\n", totalPages); // Reserve pages for the kernel. -- cgit v1.2.3