diff options
author | Missy Connell <missyc@us.ibm.com> | 2011-09-19 15:13:28 -0500 |
---|---|---|
committer | Melissa J. Connell <missyc@us.ibm.com> | 2011-10-06 11:41:57 -0500 |
commit | fdbe0a754e64fb8c4c7cb9aa98184ca87a867e22 (patch) | |
tree | fe4b3b6dc6b84c0e494dd6ab305e1e60635dd7d7 /src/usr/testcore | |
parent | 336f6ac6abc1d5ee4efc1229be06a66baf06643b (diff) | |
download | talos-hostboot-fdbe0a754e64fb8c4c7cb9aa98184ca87a867e22.tar.gz talos-hostboot-fdbe0a754e64fb8c4c7cb9aa98184ca87a867e22.zip |
pge permission functionality..
Add code that applies the permissions requested.
Add merge conflicts
Change-Id: I5911406ba4670714faaf4880399da71692559397
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/353
Tested-by: Jenkins Server
Reviewed-by: Melissa J. Connell <missyc@us.ibm.com>
Diffstat (limited to 'src/usr/testcore')
-rw-r--r-- | src/usr/testcore/kernel/slbtest.H | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/src/usr/testcore/kernel/slbtest.H b/src/usr/testcore/kernel/slbtest.H index d3613720c..fef88b5d5 100644 --- a/src/usr/testcore/kernel/slbtest.H +++ b/src/usr/testcore/kernel/slbtest.H @@ -110,16 +110,48 @@ class slbtest: public CxxTest::TestSuite void testSetPerm() { - int rc = -1; + int rc = 1; uint64_t va = 0xC800000000; //800GB uint64_t size = 0x0; - PAGE_PERMISSIONS access = WRITABLE; //Access value - printk("Update Page Permissions. but not real page or address\n"); + uint64_t access = (uint64_t)(WRITABLE | ALLOCATE_FROM_ZERO); //Access value + printkd("Update Page Permissions. Writable/Allocate from zero to addr 800Gb and size = 0 \n"); + rc = mm_set_permission(reinterpret_cast<void*>(va), size, access); + if (rc != 0) + { + TS_FAIL(" 1 Failed to Update permissions.\n"); + } + + rc = 1; + size = PAGESIZE * 3; + access = (uint64_t)(WRITE_TRACKED); //Access value + printkd("Update Page Permissions. write_tracked to addr 800Gb and size = 3 pages\n"); + rc = mm_set_permission(reinterpret_cast<void*>(va), size, access); + if (rc != 0) + { + TS_FAIL("2 Failed to Update permissions.\n"); + } + rc = 1; + va = 0xC800000000 + (PAGESIZE * 10); + size = PAGESIZE * 2; + access = (uint64_t)(EXECUTABLE); //Access value + printkd("Update Page Permissions. executable to addr C800A000 and size = 2 pages\n"); rc = mm_set_permission(reinterpret_cast<void*>(va), size, access); if (rc != 0) { - TS_FAIL("Failed to Update permissions.\n"); + TS_FAIL("3 Failed to Update permissions.\n"); } + rc = 0; + va = 0xC800000000; //800GB + size = 0x0; + access = (uint64_t)(WRITABLE | EXECUTABLE); //Access value + printkd("Update Page Permissions. Writable/executable to addr 800Gb and size = 0 \n"); + rc = mm_set_permission(reinterpret_cast<void*>(va), size, access); + if (rc == 0) + { + printk("Error .. invalid combination that did not get detected\n"); + TS_FAIL(" 4 Failed to detect a bad parm condition.\n"); + } + } private: |