diff options
author | Missy Connell <missyc@us.ibm.com> | 2011-10-25 11:12:55 -0500 |
---|---|---|
committer | Melissa J. Connell <missyc@us.ibm.com> | 2011-10-27 15:56:31 -0500 |
commit | 9e86b070a4429e7db34a5438611a67098ab92dfb (patch) | |
tree | 52e04b08288a7496359c41eff98e8463e73ae5dc /src/kernel/basesegment.C | |
parent | 71564141e3a6c7f023a9484549baf319f0e1807e (diff) | |
download | talos-hostboot-9e86b070a4429e7db34a5438611a67098ab92dfb.tar.gz talos-hostboot-9e86b070a4429e7db34a5438611a67098ab92dfb.zip |
Full permissions with no_access as default
MERGED changes.. only need Patrick and Mark to review extintsvctasks.H
Change-Id: Iba5814e1b5913c6181a2be96df9682555fa2ab58
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/458
Tested-by: Jenkins Server
Reviewed-by: Melissa J. Connell <missyc@us.ibm.com>
Diffstat (limited to 'src/kernel/basesegment.C')
-rw-r--r-- | src/kernel/basesegment.C | 41 |
1 files changed, 6 insertions, 35 deletions
diff --git a/src/kernel/basesegment.C b/src/kernel/basesegment.C index e55c3b735..7b33eed7a 100644 --- a/src/kernel/basesegment.C +++ b/src/kernel/basesegment.C @@ -80,14 +80,14 @@ void BaseSegment::_init() // Set pages in kernel text section to be read-only / executable. if (((uint64_t)&data_load_address) > i) { - iv_block->setPhysicalPage(i, i, VmmManager::RO_EXE_ACCESS); + // Set the Text section to Excutable (implies read) + iv_block->setPhysicalPage(i, i, EXECUTABLE); } // Set all other pages to initially be read/write. VFS will set // permissions on pages outside kernel. - // (@TODO: Future Sprint, for now keep NORMAL_ACCESS as RWX, not RW.) else { - iv_block->setPhysicalPage(i, i, VmmManager::NORMAL_ACCESS); + iv_block->setPhysicalPage(i, i, WRITABLE); } } } @@ -164,39 +164,10 @@ int BaseSegment::mmSetPermission(void* i_va, uint64_t i_size, uint64_t i_access_ */ int BaseSegment::_mmSetPermission(void* i_va, uint64_t i_size, uint64_t i_access_type) { - int l_rc = 0; - Block *l_block = iv_block; - uint64_t l_va = reinterpret_cast<uint64_t>(i_va); - - - do - { - // If the va is not part of this block - if (!(l_block->isContained(l_va))) - { - // Check to see if there is a next block - if (l_block->iv_nextBlock) - { - // set local block to the next block - l_block = l_block->iv_nextBlock; - } - else - { - // address passed in does not fall into a block - return -EINVAL; - } - } - // The virtual address falls within this block - else - { - // Set the permission on the the current block. - return(l_block->mmSetPermission(l_va, i_size, i_access_type)); - - } - } while (l_block); - - return l_rc; + Block *l_block = iv_block; + uint64_t l_va = reinterpret_cast<uint64_t>(i_va); + return (l_block->mmSetPermission(l_va, i_size, i_access_type)); } void BaseSegment::castOutPages(uint64_t i_type) |