summaryrefslogtreecommitdiffstats
path: root/src/usr/testcore
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2011-08-08 09:36:04 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2011-09-06 12:18:36 -0500
commitf093b902e49a0ee46d232cd196ec48f88f801735 (patch)
treec6d540acf79d21e21c936a381968e4158fee29c7 /src/usr/testcore
parentdcf7c7f2c3be17df41e3cc483dbec6f085b05353 (diff)
downloadtalos-hostboot-f093b902e49a0ee46d232cd196ec48f88f801735.tar.gz
talos-hostboot-f093b902e49a0ee46d232cd196ec48f88f801735.zip
Adding a basic interface and implementation to the Segment/Block
path to update the LRU statistics when the PageTableManager code clears the reference bit. This is not meant to be a complete implementation (different Task is open for that). This is Task 3400. Change-Id: If67efd16ead6f68a74f5f5a698013c1b852864d9 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/231 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/testcore')
-rw-r--r--src/usr/testcore/kernel/ptmgrtest.H32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/usr/testcore/kernel/ptmgrtest.H b/src/usr/testcore/kernel/ptmgrtest.H
index 9d1793710..c32573a43 100644
--- a/src/usr/testcore/kernel/ptmgrtest.H
+++ b/src/usr/testcore/kernel/ptmgrtest.H
@@ -95,8 +95,7 @@ class ptmgrtest : public CxxTest::TestSuite
*/
void test_hash40( void )
{
- TS_TRACE( ">> test_hash40 <<" );
- printkd( ">> test_hash40 <<\n" );
+ TS_TRACE( ">> ptmgrtest::test_hash40 <<" );
uint64_t fails, total = 0;
// Initialize the Page Table
@@ -123,7 +122,6 @@ class ptmgrtest : public CxxTest::TestSuite
delete ptmgr;
TS_TRACE( "ptmgrtest::test_hash40> fails=%d/%d", fails, total );
- printkd( "ptmgrtest::test_hash40> fails=%ld/%ld\n", fails, total );
}
/**
@@ -134,8 +132,7 @@ class ptmgrtest : public CxxTest::TestSuite
*/
void test_addEntry( void )
{
- TS_TRACE( ">> test_addEntry <<" );
- printkd( ">> test_addEntry <<\n" );
+ TS_TRACE( ">> ptmgrtest::test_addEntry <<" );
uint64_t fails = 0;
uint64_t total = 0;
uint64_t status = 0;
@@ -160,6 +157,16 @@ class ptmgrtest : public CxxTest::TestSuite
else if( (status & PageTableManager::PTE_VALID) && (pn == TEST_DATA[x].page) )
{
PASS_TRACE( "ptmgrtest::test_addEntry> PASS1 : 0x%.16lX", TEST_DATA[x].va );
+
+ PageTableManager::PageTableEntry* pte = ptmgr->findPTE(TEST_DATA[x].va);
+ uint64_t va = ptmgr->getVirtAddrFromPTE(pte);
+ if( va != (TEST_DATA[x].va - TEST_DATA[x].va%4096) )
+ {
+ printk( "ptmgrtest::test_addEntry> ERROR6 : VA doesn't match expected" );
+ printk( "Exp=%.16lX, Act=%.16lX", TEST_DATA[x].va, va );
+ fails++;
+ }
+ total++;
}
else
{
@@ -217,7 +224,6 @@ class ptmgrtest : public CxxTest::TestSuite
delete ptmgr;
TS_TRACE( "ptmgrtest::test_addEntry> fails=%d/%d", fails, total );
- printkd( "ptmgrtest::test_addEntry> fails=%ld/%ld\n", fails, total );
}
/**
@@ -227,8 +233,7 @@ class ptmgrtest : public CxxTest::TestSuite
*/
void test_delEntry( void )
{
- TS_TRACE( ">> test_delEntry <<" );
- printkd( ">> test_delEntry <<\n" );
+ TS_TRACE( ">> ptmgrtest::test_delEntry <<" );
uint64_t fails = 0;
uint64_t total = 0;
uint64_t ignored = 0;
@@ -266,7 +271,6 @@ class ptmgrtest : public CxxTest::TestSuite
delete ptmgr;
TS_TRACE( "ptmgrtest::test_delEntry> fails=%d/%d", fails, total );
- printkd( "ptmgrtest::test_delEntry> fails=%ld/%ld\n", fails, total );
}
/**
@@ -277,8 +281,7 @@ class ptmgrtest : public CxxTest::TestSuite
*/
void test_delRangeVA( void )
{
- TS_TRACE( ">> test_delRangeVA <<" );
- printkd( ">> test_delRangeVA <<\n" );
+ TS_TRACE( ">> ptmgrtest::test_delRangeVA <<" );
uint64_t fails = 0;
uint64_t total = 0;
uint64_t ignored = 0;
@@ -326,7 +329,6 @@ class ptmgrtest : public CxxTest::TestSuite
delete ptmgr;
TS_TRACE( "ptmgrtest::test_delRangeVA> fails=%d/%d", fails, total );
- printkd( "ptmgrtest::test_delRangeVA> fails=%ld/%ld\n", fails, total );
}
/**
@@ -337,8 +339,7 @@ class ptmgrtest : public CxxTest::TestSuite
*/
void test_delRangePN( void )
{
- TS_TRACE( ">> test_delRangePN <<" );
- printkd( ">> test_delRangePN <<\n" );
+ TS_TRACE( ">> ptmgrtest::test_delRangePN <<" );
uint64_t fails = 0;
uint64_t total = 0;
uint64_t pagenum = 0;
@@ -390,11 +391,12 @@ class ptmgrtest : public CxxTest::TestSuite
delete ptmgr;
TS_TRACE( "ptmgrtest::test_delRangePN> fails=%d/%d", fails, total );
- printkd( "ptmgrtest::test_delRangePN> fails=%ld/%ld\n", fails, total );
}
//@todo - Test LRU
+ //@todo - Test propagation of C/R bits to blocks
+
private:
/**
* @brief Populate the table with entries
OpenPOWER on IntegriCloud