summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/kernel/cpumgr.H4
-rw-r--r--src/include/kernel/pagemgr.H189
-rw-r--r--src/include/kernel/syscalls.H48
-rw-r--r--src/include/sys/mm.h51
-rw-r--r--src/kernel/pagemgr.C223
-rw-r--r--src/kernel/syscall.C13
-rw-r--r--src/lib/syscall_mm.C53
-rw-r--r--src/usr/testcore/kernel/vmmbasetest.H6
8 files changed, 420 insertions, 167 deletions
diff --git a/src/include/kernel/cpumgr.H b/src/include/kernel/cpumgr.H
index 93dbba9df..ca16d16d6 100644
--- a/src/include/kernel/cpumgr.H
+++ b/src/include/kernel/cpumgr.H
@@ -35,8 +35,8 @@ class CpuManager
enum
{
MAXCPUS = KERNEL_MAX_SUPPORTED_CPUS,
- CPU_PERIODIC_CHECK_MEMORY = 8,
- CPU_PERIODIC_FLUSH_PAGETABLE = 128,
+ CPU_PERIODIC_CHECK_MEMORY = 128, // Is this even needed anymore?
+ CPU_PERIODIC_FLUSH_PAGETABLE = 256,
CPU_PERIODIC_DEFRAG = 949, // TODO Any bigger not currently hit
};
diff --git a/src/include/kernel/pagemgr.H b/src/include/kernel/pagemgr.H
index e0d2aa1fa..6676a469c 100644
--- a/src/include/kernel/pagemgr.H
+++ b/src/include/kernel/pagemgr.H
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/kernel/pagemgr.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2010 - 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/kernel/pagemgr.H $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2010-2012
+ *
+ * p1
+ *
+ * Object Code Only (OCO) source materials
+ * Licensed Internal Code Source Materials
+ * IBM HostBoot Licensed Internal Code
+ *
+ * The source code for this program is not published or other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
#ifndef __KERNEL_PAGEMGR_H
#define __KERNEL_PAGEMGR_H
@@ -32,17 +33,118 @@
#include <util/align.H>
#include <sys/vfs.h>
+/** @class PageManagerCore
+ * @brief Manages the allocation of memory pages
+ */
+class PageManagerCore
+{
+ public:
+ enum
+ {
+ BUCKETS = 16,
+ };
+
+ struct page_t
+ {
+ page_t* next; //!< Next block of pages
+ page_t* prev; //!< Prev block of pages
+ page_t* key; //!< Key for pqueue
+ };
+
+ /**
+ * Default Constructor
+ */
+ PageManagerCore()
+ : iv_available(0) {}
+
+ /**
+ * Add memory to the page manager
+ * @param[in] i_addr, The start address of the memory to add
+ * @param[in] i_pageCount, The number of pages to add
+ * @note i_addr must be on a page boundary
+ */
+ void addMemory( size_t i_addr, size_t i_pageCount );
+
+ /**
+ * Destructor
+ */
+ ~PageManagerCore( void ) {}
+
+ /**
+ * Request page allocations
+ * @param[in] i_pageCount, The number of pages requested
+ * @return a pointer to the requested allocation | NULL
+ * if the request could not be satisfied.
+ */
+ page_t * allocatePage( size_t i_pageCount );
+
+ /**
+ * Return page allocations to the page manager
+ * @param[in] i_page, pointer to the allocation
+ * @param[in] i_pageCount, the number of pages in the allocation
+ */
+ void freePage( void * i_page, size_t i_pageCount );
+
+ /**
+ * Coalesce pages in the page manager (defrag)
+ */
+ void coalesce( void );
+
+ /**
+ * Query the the current number of pages in the page manager
+ */
+ ALWAYS_INLINE
+ size_t getFreePageCount() const { return iv_available; }
+
+ /**
+ * Get the start of memory after the code
+ */
+ ALWAYS_INLINE uint64_t firstPageAddr( void ) const
+ {
+ return ALIGN_PAGE(VFS_LAST_ADDRESS);
+ }
+
+ private:
+
+ size_t iv_available; //!< free pages
+ Util::Lockfree::Stack<page_t> iv_heap[BUCKETS]; //!< The heap
+
+ /**
+ * Find a page of proper size
+ * @param[in] the Size
+ * @return a page ptr to a page of size pages
+ */
+ page_t* pop_bucket(size_t);
+
+ /**
+ * Add a pages to the page manager
+ * @param[in] ptr to the allocation
+ * @param[in] The number of pages
+ */
+ void push_bucket(page_t*, size_t);
+};
+
/** @class PageManager
* @brief Manages the allocation of memory pages.
*/
-
class PageManager
{
public:
static void init();
+ /**
+ * Allocate pages
+ * @param[in] n, Requested allocation in pages
+ * @return pointer to requested memory
+ */
static void* allocatePage(size_t n = 1);
+
+ /**
+ * Return pages to the pagemanager
+ * @param[in] ptr to storage to release
+ * @param[in] n, size in pages
+ */
static void freePage(void*, size_t n = 1);
/**
@@ -67,9 +169,12 @@ class PageManager
enum
{
MEMLEN = VmmManager::MBOX_DMA_ADDR,
- BUCKETS = 16,
+ RESERVED_PAGES = 4,
};
+ static size_t cv_coalesce_count; //!< running coalesced counter
+ static size_t cv_low_page_count; //!< lowest page count
+
protected:
PageManager();
@@ -77,19 +182,25 @@ class PageManager
private:
- void* _allocatePage(size_t);
- void _freePage(void*, size_t);
+ void* _allocatePage(size_t); //!< see allocatePage()
+ void _freePage(void*, size_t); //!< see freePage()
void _coalesce( void ); //!< see coalesce()
+ /**
+ * Query if in kernel mode
+ * @return [true | false]
+ */
+ bool queryKernelMode() const;
+
/** see queryAvail() */
ALWAYS_INLINE uint64_t _queryAvail() const
{
return (100*iv_pagesAvail)/iv_pagesTotal;
}
- ALWAYS_INLINE uint64_t firstPageAddr( void )
+ ALWAYS_INLINE uint64_t firstPageAddr( void ) const
{
- return ALIGN_PAGE(VFS_LAST_ADDRESS);
+ return iv_heap.firstPageAddr();
}
/** see availPages() */
@@ -98,24 +209,14 @@ class PageManager
return iv_pagesAvail;
}
- /** Statistics on number of free pages (for debug) */
- uint64_t iv_pagesAvail;
- /** Total number of pages */
- uint64_t iv_pagesTotal;
-
- static size_t cv_coalesce_count; //!< running coalesced counter
- static size_t cv_low_page_count; //!< lowest page count
+ // Private data
- struct page_t
- {
- page_t* next; //!< Next block of pages
- page_t* prev; //!< Prev block of pages
- page_t* key; //!< Key for pqueue
- };
- Util::Lockfree::Stack<page_t> first_page[BUCKETS];
+ uint64_t iv_pagesAvail; //!< free pages (for debug)
+ uint64_t iv_pagesTotal; //!< Total number o fpages
+ uint64_t iv_lock; //!< lock for checking low heap
- page_t* pop_bucket(size_t);
- void push_bucket(page_t*, size_t);
+ PageManagerCore iv_heap; //!< Main heap
+ PageManagerCore iv_heapKernel; //!< kernel heap for out-of-mem
};
#endif
diff --git a/src/include/kernel/syscalls.H b/src/include/kernel/syscalls.H
index dbcfaf175..20cfd4e65 100644
--- a/src/include/kernel/syscalls.H
+++ b/src/include/kernel/syscalls.H
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/kernel/syscalls.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2010 - 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/kernel/syscalls.H $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2010-2012
+ *
+ * p1
+ *
+ * Object Code Only (OCO) source materials
+ * Licensed Internal Code Source Materials
+ * IBM HostBoot Licensed Internal Code
+ *
+ * The source code for this program is not published or other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
/** @file syscalls.H
* @brief Defines all the system call IDs to be shared between the kernel and
* the system libc.
@@ -96,6 +97,9 @@ namespace Systemcalls
/** mm_set_permission() */
MM_SET_PERMISSION,
+ /** mm_flush_pages() */
+ MM_FLUSH_PAGES,
+
SYSCALL_MAX
};
diff --git a/src/include/sys/mm.h b/src/include/sys/mm.h
index 3064e371a..105b145be 100644
--- a/src/include/sys/mm.h
+++ b/src/include/sys/mm.h
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/sys/mm.h $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/sys/mm.h $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2011-2012
+ *
+ * p1
+ *
+ * Object Code Only (OCO) source materials
+ * Licensed Internal Code Source Materials
+ * IBM HostBoot Licensed Internal Code
+ *
+ * The source code for this program is not published or other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
#ifndef __SYS_MM_H
#define __SYS_MM_H
@@ -96,6 +97,12 @@ int mm_remove_pages(PAGE_REMOVAL_OPS i_op, void* i_vaddr, uint64_t i_size);
*/
int mm_set_permission(void* va, uint64_t size, uint64_t access_type);
+/** @fn mm_flush_pages()
+ * @brief System call to flush pages
+ * @param[in] i_sev - [VmmManager::NORMAL | VmmManager::CRITIAL]
+ */
+void mm_flush_pages(uint64_t i_sev);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/kernel/pagemgr.C b/src/kernel/pagemgr.C
index fb969ce87..3991ff920 100644
--- a/src/kernel/pagemgr.C
+++ b/src/kernel/pagemgr.C
@@ -29,10 +29,79 @@
#include <util/locked/pqueue.H>
#include <kernel/task.H>
#include <kernel/taskmgr.H>
+#include <usr/vmmconst.h>
+#include <kernel/vmmmgr.H>
+#include <sys/task.h>
+#include <sys/mm.h>
size_t PageManager::cv_coalesce_count = 0;
size_t PageManager::cv_low_page_count = -1;
+
+void PageManagerCore::addMemory( size_t i_addr, size_t i_pageCount )
+{
+ size_t length = i_pageCount;
+ page_t* page = reinterpret_cast<page_t *>(ALIGN_PAGE(i_addr));
+
+ // Allocate pages to buckets.
+ size_t page_length = BUCKETS-1;
+ while(length > 0)
+ {
+ while (length < (size_t)(1 << page_length))
+ {
+ page_length--;
+ }
+
+ iv_heap[page_length].push(page);
+ page = (page_t*)((uint64_t)page + (1 << page_length)*PAGESIZE);
+ length -= (1 << page_length);
+ }
+ __sync_add_and_fetch(&iv_available, i_pageCount);
+}
+
+
+
+PageManagerCore::page_t * PageManagerCore::allocatePage( size_t i_pageCount )
+{
+ size_t which_bucket = 0;
+ while (i_pageCount > (size_t)(1 << which_bucket)) which_bucket++;
+
+ page_t* page = (page_t*)NULL;
+ int retries = 0;
+ while ((page == NULL) && (retries < 6))
+ {
+ page = pop_bucket(which_bucket);
+ retries++;
+ }
+
+ // Update statistics.
+ if(page)
+ {
+ __sync_sub_and_fetch(&iv_available, i_pageCount);
+ }
+
+ return page;
+}
+
+
+
+void PageManagerCore::freePage( void * i_page, size_t i_pageCount )
+{
+ if ((NULL == i_page) || (0 == i_pageCount)) return;
+
+ size_t which_bucket = 0;
+ while (i_pageCount > (size_t)(1 << which_bucket)) which_bucket++;
+
+ push_bucket((page_t*)i_page, which_bucket);
+
+ // Update statistics.
+ __sync_add_and_fetch(&iv_available, i_pageCount);
+
+ return;
+}
+
+
+
void PageManager::init()
{
Singleton<PageManager>::instance();
@@ -60,23 +129,19 @@ uint64_t PageManager::availPages()
return Singleton<PageManager>::instance()._availPages();
}
-PageManager::PageManager() : iv_pagesAvail(0), iv_pagesTotal(0)
+PageManager::PageManager()
+ : iv_pagesAvail(0), iv_pagesTotal(0), iv_lock(0)
{
// Determine first page of un-allocated memory
// and number of pages available.
uint64_t addr = firstPageAddr();
size_t length = (MEMLEN - addr) / PAGESIZE;
- page_t* page = reinterpret_cast<page_t *>(addr);
- iv_pagesTotal = length;
- // Update statistics.
- __sync_add_and_fetch(&iv_pagesAvail, length);
- cv_low_page_count = iv_pagesAvail;
// Display.
printk("Initializing PageManager with %zd pages starting at %lx...",
length,
- (uint64_t)page);
+ addr);
// Populate L3 cache lines.
uint64_t* cache_line = reinterpret_cast<uint64_t*>(addr);
@@ -87,40 +152,77 @@ PageManager::PageManager() : iv_pagesAvail(0), iv_pagesTotal(0)
cache_line += getCacheLineWords();
}
- // Allocate pages to buckets.
- size_t page_length = BUCKETS-1;
- while(length > 0)
- {
- while (length < (size_t)(1 << page_length))
- page_length--;
+ // Allocate pages
+ iv_heapKernel.addMemory( addr, RESERVED_PAGES );
+ addr += RESERVED_PAGES * PAGESIZE;
+ length -= RESERVED_PAGES;
+
+ iv_heap.addMemory( addr, length );
+
+ // Statistics
+ iv_pagesTotal = length;
+ iv_pagesAvail = length;
+ cv_low_page_count = length;
- first_page[page_length].push(page);
- page = (page_t*)((uint64_t)page + (1 << page_length)*PAGESIZE);
- length -= (1 << page_length);
- }
// @TODO: Venice: Clear 3-8MB region and add to free memory pool.
// Can't do this now due to fake-PNOR driver.
+ // iv_heap.addMemory(...);
printk("done\n");
}
void* PageManager::_allocatePage(size_t n)
{
- size_t which_bucket = 0;
- while (n > (size_t)(1 << which_bucket)) which_bucket++;
+ PageManagerCore::page_t* page = NULL;
- int retries = 0;
- page_t* page = (page_t*)NULL;
- while ((page == NULL) && (retries < 6))
+ // Initiate a page cast out if low
+ if(_queryAvail() < 16 && queryKernelMode() == false)
{
- page = pop_bucket(which_bucket);
- retries++;
+ // Kernel mode might have Vmm mutex lock which would cause deadlock
+ // were VmmManager functions called to flush and cast out.
+
+ // Only want one thread testing and flushing
+ if(__sync_bool_compare_and_swap(&(iv_lock),0,1))
+ {
+ if(_queryAvail() < 5)
+ {
+ mm_flush_pages(VmmManager::CRITICAL);
+ }
+ else
+ {
+ mm_flush_pages(VmmManager::NORMAL);
+ }
+ iv_lock = 0;
+ }
+ }
+
+ while(page == NULL)
+ {
+ page = iv_heap.allocatePage(n);
+
+ if(NULL == page)
+ {
+ if(queryKernelMode() == true)
+ {
+ printkd("PAGEMANAGER: kernel heap used\n");
+ page = iv_heapKernel.allocatePage(n);
+ break;
+ }
+ else
+ {
+ //task yield and hope there is more memory available
+ //when execution continues
+ printkd("PAGEMANAGER: Task held off\n");
+ task_yield();
+
+ //Possible Loop forever? or is there a break condition??
+ }
+ }
}
if (NULL == page)
{
- // TODO: Add abort instead?
register task_t* t;
asm volatile("mr %0, 13" : "=r"(t));
printk("Insufficient memory for alloc of size %zd page on tid=%d!\n", n, t->tid);
@@ -140,43 +242,53 @@ void* PageManager::_allocatePage(size_t n)
void PageManager::_freePage(void* p, size_t n)
{
- if ((NULL == p) || (0 == n)) return;
-
- size_t which_bucket = 0;
- while (n > (size_t)(1 << which_bucket)) which_bucket++;
-
- push_bucket((page_t*)p, which_bucket);
+ iv_heap.freePage(p,n);
// Update statistics.
__sync_add_and_fetch(&iv_pagesAvail, n);
+ // Keep the reserved page count for the kernel full
+ // Should it be continuous RESERVED_PAGES??
+ size_t ks = iv_heapKernel.getFreePageCount();
+ if(ks < RESERVED_PAGES)
+ {
+ ks = RESERVED_PAGES - ks;
+ PageManagerCore::page_t * page = iv_heap.allocatePage(ks);
+ if(page)
+ {
+ iv_heapKernel.addMemory(reinterpret_cast<size_t>(page), ks);
+ __sync_sub_and_fetch(&iv_pagesAvail, ks);
+ }
+ }
+
+
return;
}
-PageManager::page_t* PageManager::pop_bucket(size_t n)
+PageManagerCore::page_t* PageManagerCore::pop_bucket(size_t i_n)
{
- if (n >= BUCKETS) return NULL;
+ if (i_n >= BUCKETS) return NULL;
- page_t* p = first_page[n].pop();
+ page_t* p = iv_heap[i_n].pop();
if (NULL == p)
{
// Couldn't allocate from the correct size bucket, so split up an
// item from the next sized bucket.
- p = pop_bucket(n+1);
+ p = pop_bucket(i_n+1);
if (NULL != p)
{
- push_bucket((page_t*) (((uint64_t)p) + (PAGESIZE * (1 << n))),
- n);
+ push_bucket((page_t*) (((uint64_t)p) + (PAGESIZE * (1 << i_n))),
+ i_n);
}
}
return p;
}
-void PageManager::push_bucket(page_t* p, size_t n)
+void PageManagerCore::push_bucket(page_t* i_p, size_t i_n)
{
- if (n >= BUCKETS) return;
- first_page[n].push(p);
+ if (i_n >= BUCKETS) return;
+ iv_heap[i_n].push(i_p);
}
void PageManager::coalesce( void )
@@ -184,9 +296,13 @@ void PageManager::coalesce( void )
Singleton<PageManager>::instance()._coalesce();
}
+void PageManager::_coalesce( void )
+{
+ iv_heap.coalesce();
+}
// Coalsesce adjacent free memory blocks
-void PageManager::_coalesce( void )
+void PageManagerCore::coalesce( void )
{
// TODO: Issue 44511 - Function appears to leak memory.
return;
@@ -203,7 +319,7 @@ void PageManager::_coalesce( void )
// sorted by address, highest to lowest
Util::Locked::PQueue<page_t,page_t*> pq;
page_t * p = NULL;
- while(NULL != (p = first_page[bucket].pop()))
+ while(NULL != (p = iv_heap[bucket].pop()))
{
p->key = p;
pq.insert(p);
@@ -218,7 +334,7 @@ void PageManager::_coalesce( void )
((1 << bucket)*PAGESIZE);
if(0 != (p_idx % 2)) // odd index
{
- first_page[bucket].push(p); // can't merge
+ iv_heap[bucket].push(p); // can't merge
}
else // it's even
{
@@ -234,16 +350,16 @@ void PageManager::_coalesce( void )
// new block is twice the size and goes into the next
// bucket size
push_bucket(p,bucket+1);
- ++cv_coalesce_count;
+ ++PageManager::cv_coalesce_count;
}
else
{
// Can't merge p
- first_page[bucket].push(p);
+ iv_heap[bucket].push(p);
if(p_next) // This should be null - if then overlaping mem
{
- first_page[bucket].push(p_next);
+ iv_heap[bucket].push(p_next);
printk("pagemgr::coalesce Expected %p, got %p\n",
p_seek, p_next);
}
@@ -251,8 +367,17 @@ void PageManager::_coalesce( void )
}
}
}
- printkd("PAGEMGR coalesced total %ld\n", cv_coalesce_count);
- printkd("PAGEMGR low page count %ld\n",cv_low_page_count);
+ printkd("PAGEMGR coalesced total %ld\n", PageManager::cv_coalesce_count);
+ printkd("PAGEMGR low page count %ld\n", PageManager::cv_low_page_count);
}
-
+bool PageManager::queryKernelMode() const
+{
+ uint64_t stack = 0;
+ asm volatile("mr %0, 1" : "=r"(stack));
+ if(stack >= VMM_VADDR_STACK_SEGMENT && stack < VMM_VADDR_DEVICE_SEGMENT_FIRST)
+ {
+ return false;
+ }
+ return true;
+}
diff --git a/src/kernel/syscall.C b/src/kernel/syscall.C
index dd3d10949..1ed68624e 100644
--- a/src/kernel/syscall.C
+++ b/src/kernel/syscall.C
@@ -101,6 +101,7 @@ namespace Systemcalls
void MmAllocBlock(task_t *t);
void MmRemovePages(task_t *t);
void MmSetPermission(task_t *t);
+ void MmFlushPages(task_t *t);
syscall syscalls[] =
@@ -134,6 +135,7 @@ namespace Systemcalls
&MmAllocBlock, // MM_ALLOC_BLOCK
&MmRemovePages, // MM_REMOVE_PAGES
&MmSetPermission, // MM_SET_PERMISSION
+ &MmFlushPages, // MM_FLUSH_PAGES
};
};
@@ -668,5 +670,16 @@ namespace Systemcalls
TASK_SETRTN(t, VmmManager::mmSetPermission(va,size, access_type));
}
+ /**
+ * Flush and Cast out 'old' pages
+ * @param[in] t: The task used.
+ */
+ void MmFlushPages(task_t* t)
+ {
+ VmmManager::castout_t sev = (VmmManager::castout_t)TASK_GETARG0(t);
+ VmmManager::flushPageTable();
+ VmmManager::castOutPages(sev);
+ TASK_SETRTN(t,0);
+ }
};
diff --git a/src/lib/syscall_mm.C b/src/lib/syscall_mm.C
index 129f304da..006586f81 100644
--- a/src/lib/syscall_mm.C
+++ b/src/lib/syscall_mm.C
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/lib/syscall_mm.C $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/lib/syscall_mm.C $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2011-2012
+ *
+ * p1
+ *
+ * Object Code Only (OCO) source materials
+ * Licensed Internal Code Source Materials
+ * IBM HostBoot Licensed Internal Code
+ *
+ * The source code for this program is not published or other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
#include <sys/syscall.h>
#include <sys/mm.h>
#include <arch/ppc.H>
@@ -80,3 +81,11 @@ int mm_set_permission(void* va, uint64_t size, uint64_t access_type)
{
return (int64_t)_syscall3(MM_SET_PERMISSION, va, (void*)size, (void*)access_type);
}
+
+/**
+ * System call to flush pages
+ */
+void mm_flush_pages(uint64_t i_sev)
+{
+ _syscall1(MM_FLUSH_PAGES, (void*)i_sev);
+}
diff --git a/src/usr/testcore/kernel/vmmbasetest.H b/src/usr/testcore/kernel/vmmbasetest.H
index 3587c1e85..2df580e1c 100644
--- a/src/usr/testcore/kernel/vmmbasetest.H
+++ b/src/usr/testcore/kernel/vmmbasetest.H
@@ -93,12 +93,6 @@ class VmmBaseTest : public CxxTest::TestSuite
void testCastOutPages()
{
-
- //Disabled until page management issues are fixed.
- //RTC: 43209 (task) created to track reenable of this test case.
- printk("testCastOutPages: Disabled until page management issues are fixed. ");
- return;
-
uint64_t l_testAddr = VMM_VADDR_RMVPAGE_TEST;
uint64_t l_testSize = VMM_SIZE_RMVPAGE_TEST;
uint64_t vaddr = l_testAddr+l_testSize;
OpenPOWER on IntegriCloud