summaryrefslogtreecommitdiffstats
path: root/src/kernel/basesegment.C
diff options
context:
space:
mode:
authorMissy Connell <missyc@us.ibm.com>2011-10-25 11:12:55 -0500
committerMelissa J. Connell <missyc@us.ibm.com>2011-10-27 15:56:31 -0500
commit9e86b070a4429e7db34a5438611a67098ab92dfb (patch)
tree52e04b08288a7496359c41eff98e8463e73ae5dc /src/kernel/basesegment.C
parent71564141e3a6c7f023a9484549baf319f0e1807e (diff)
downloadtalos-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.C41
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)
OpenPOWER on IntegriCloud