summaryrefslogtreecommitdiffstats
path: root/src/include/kernel
diff options
context:
space:
mode:
authorMissy Connell <missyc@us.ibm.com>2011-09-19 15:13:28 -0500
committerMelissa J. Connell <missyc@us.ibm.com>2011-10-06 11:41:57 -0500
commitfdbe0a754e64fb8c4c7cb9aa98184ca87a867e22 (patch)
treefe4b3b6dc6b84c0e494dd6ab305e1e60635dd7d7 /src/include/kernel
parent336f6ac6abc1d5ee4efc1229be06a66baf06643b (diff)
downloadblackbird-hostboot-fdbe0a754e64fb8c4c7cb9aa98184ca87a867e22.tar.gz
blackbird-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/include/kernel')
-rw-r--r--src/include/kernel/basesegment.H4
-rw-r--r--src/include/kernel/block.H16
-rw-r--r--src/include/kernel/spte.H12
-rw-r--r--src/include/kernel/vmmmgr.H4
4 files changed, 27 insertions, 9 deletions
diff --git a/src/include/kernel/basesegment.H b/src/include/kernel/basesegment.H
index 574be1a1f..1064e1f82 100644
--- a/src/include/kernel/basesegment.H
+++ b/src/include/kernel/basesegment.H
@@ -105,7 +105,7 @@ class BaseSegment : public Segment
*/
static int mmSetPermission(void* i_va,
uint64_t i_size,
- PAGE_PERMISSIONS i_access_type);
+ uint64_t i_access_type);
/**
* @breif Cast out older physical memory pages
* @param[in] castout Constraint
@@ -144,7 +144,7 @@ class BaseSegment : public Segment
*/
int _mmSetPermission(void* i_va,
uint64_t i_size,
- PAGE_PERMISSIONS i_access_type);
+ uint64_t i_access_type);
};
diff --git a/src/include/kernel/block.H b/src/include/kernel/block.H
index 88c6664c2..405791e94 100644
--- a/src/include/kernel/block.H
+++ b/src/include/kernel/block.H
@@ -32,6 +32,7 @@
#include <kernel/blockmsghdlr.H>
#include <kernel/msghandler.H>
#include <kernel/ptmgr.H>
+#include <sys/mm.h>
class ShadowPTE;
class Segment;
@@ -232,6 +233,21 @@ class Block
*/
void releaseAllPages();
+ /**
+ * @brief Sets the page permissions for a given virtual addr
+ * and a size of memory needing updated permissions
+ * @param i_va[in] - virtual address of the beginning of the
+ * pages that need updating.
+ * @param i_size[in] - range of memory that needs updating
+ * if i_size equals 0 then we only need to update an
+ * individual page.
+ * @param i_access_type[in] - type of permission to set using
+ * PAGE_PERMISSION enum values OR'd together
+ * @return int - 0 for successful block allocation,
+ * non-zero otherwise
+ */
+ int mmSetPermission(uint64_t i_va, uint64_t i_size, uint64_t i_access_type);
+
private:
/** Base address of the block */
const uint64_t iv_baseAddr;
diff --git a/src/include/kernel/spte.H b/src/include/kernel/spte.H
index abd81dff3..49c15f83c 100644
--- a/src/include/kernel/spte.H
+++ b/src/include/kernel/spte.H
@@ -53,7 +53,8 @@ class ShadowPTE
uint32_t page:20;
/** Page is present (is PN valid?). */
uint32_t present:1;
-
+ /** May the page be read */
+ uint32_t readable:1;
/** May the page be written to. */
uint32_t writable:1;
/** May code be executed off page. */
@@ -65,12 +66,10 @@ class ShadowPTE
uint32_t dirty:1;
/** Allocate from a zero'd page. */
uint32_t allocate_from_zero:1;
-
/** LRU value - lower means it was accessed more recently. */
uint32_t last_access:3;
-
/** Reserved for future use. */
- uint32_t reserved:3;
+ uint32_t reserved:2;
} PACKED;
};
@@ -91,7 +90,10 @@ class ShadowPTE
bool isPresent() const { return present; };
/** Set present bit. */
void setPresent(bool i_present) { present = i_present; };
-
+ /** Get readable bit. */
+ bool isReadable() const { return readable; };
+ /** Set readable bit. */
+ void setReadable(bool i_read) { readable = i_read; };
/** Get writable bit. */
bool isWritable() const { return writable; };
/** Set writable bit. */
diff --git a/src/include/kernel/vmmmgr.H b/src/include/kernel/vmmmgr.H
index 5c7a75d5d..ce7aedafb 100644
--- a/src/include/kernel/vmmmgr.H
+++ b/src/include/kernel/vmmmgr.H
@@ -147,7 +147,7 @@ class VmmManager
* boundary, along with the given size will be 'rounded' up to the
* nearest divisible page size.
*/
- static int mmSetPermission(void* i_va,uint64_t i_size, PAGE_PERMISSIONS i_access_type);
+ static int mmSetPermission(void* i_va,uint64_t i_size, uint64_t i_access_type);
protected:
VmmManager();
@@ -172,7 +172,7 @@ class VmmManager
uint64_t _findPhysicalAddress(uint64_t i_vaddr);
/* See mmSetPermission */
- int _mmSetPermission(void* i_va,uint64_t i_size, PAGE_PERMISSIONS i_access_type);
+ int _mmSetPermission(void* i_va,uint64_t i_size, uint64_t i_access_type);
/** See castOutPages */
void _castOutPages(castout_t i_ct);
OpenPOWER on IntegriCloud