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/include/kernel | |
| 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/include/kernel')
| -rw-r--r-- | src/include/kernel/block.H | 72 | ||||
| -rw-r--r-- | src/include/kernel/ptmgr.H | 21 | ||||
| -rw-r--r-- | src/include/kernel/segmentmgr.H | 6 | ||||
| -rw-r--r-- | src/include/kernel/vmmmgr.H | 9 |
4 files changed, 63 insertions, 45 deletions
diff --git a/src/include/kernel/block.H b/src/include/kernel/block.H index 60aeadaf0..b5ab709cc 100644 --- a/src/include/kernel/block.H +++ b/src/include/kernel/block.H @@ -140,23 +140,6 @@ class Block void updateRefCount( uint64_t i_vaddr, PageTableManager::UsageStats_t i_stats ); - /** - * @brief Cast out older phyiscal memory pages - * @param[in] i_type - Castout contraint @see VmmManager::castOutPages() - */ - void castOutPages(uint64_t i_type); - - /** - * @brief Removes a range of pages within a block of virtual memory - * @param[in] i_op - Page removal operation to perform - * @param[in] i_vaddr - Virtual address associated to page(s) - * @param[in] i_size - Size of memory to perform page removal on - * @param[in] i_task - Task requesting page removal. - * @return int - 0 for successful page removal, non-zero otherwise - */ - int removePages(VmmManager::PAGE_REMOVAL_OPS i_op, void* i_vaddr, - uint64_t i_size, task_t* i_task); - friend class Segment; friend class BaseSegment; friend class StackSegment; @@ -194,14 +177,7 @@ class Block * mode is still set. */ void setPhysicalPage(uint64_t i_vAddr, uint64_t i_pAddr, - VmmManager::ACCESS_TYPES i_access); - - /** - * @brief Set up a virtual address to be "allocate-from-zero". - * - * @param[in] i_vAddr - The virtual address of the page. - */ - void setPageAllocateFromZero(uint64_t i_vAddr); + uint64_t i_access); /** * @brief Adds up the total size of all blocks within the segment @@ -231,7 +207,7 @@ class Block * 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, + * @return int - 0 for successful permission update, * non-zero otherwise */ int mmSetPermission(uint64_t i_va, uint64_t i_size, uint64_t i_access_type); @@ -260,6 +236,50 @@ class Block */ void releasePTE(ShadowPTE* i_pte); + /** + * @brief Cast out older phyiscal memory pages + * @param[in] i_type - Castout contraint @see VmmManager::castOutPages() + */ + void castOutPages(uint64_t i_type); + + /** + * @brief Evict a memory page + * @param[in] i_pte shadow page table entry + * @return true of page was evicted + */ + bool evictPage(ShadowPTE* i_pte); + + /** + * @brief Sets the page permissions for a given SPTE + * @param i_spte[in] - i_pte shadow page table entry + * @param i_access_type[in] - type of permission to set using + * PAGE_PERMISSION enum values OR'd together + * @return int - 0 for successful update + * non-zero otherwise + */ + int setPermSPTE( ShadowPTE* i_spte, uint64_t i_access_type); + + /** + * @brief Gets the page permissions for a given SPTE + * @param i_spte[in] - i_pte shadow page table entry + * @return uint64_t - type of permission for that SPTE using + * PAGE_PERMISSION enum values OR'd together + */ + uint64_t getPermission( ShadowPTE* i_spte); + + /** + * @brief Removes a range of pages within a block of virtual memory + * @param[in] i_op - Page removal operation to perform + * @param[in] i_vaddr - Virtual address associated to page(s) + * @param[in] i_size - Size of memory to perform page removal on + * @param[in] i_task - Task requesting page removal. + * @return int - 0 for successful page removal, non-zero otherwise + */ + int removePages(VmmManager::PAGE_REMOVAL_OPS i_op, void* i_vaddr, + uint64_t i_size, task_t* i_task); + + + private: /** Base address of the block */ const uint64_t iv_baseAddr; diff --git a/src/include/kernel/ptmgr.H b/src/include/kernel/ptmgr.H index 9ae092857..918e4211f 100644 --- a/src/include/kernel/ptmgr.H +++ b/src/include/kernel/ptmgr.H @@ -44,11 +44,12 @@ class PageTableManager PTE_UNKNOWN = 0x0000000000000000, /**< Entry wasn't found */ PTE_PRESENT = 0x0000000000000001, /**< Entry is present in table */ PTE_VALID = 0x0000000000000002, /**< Entry is valid */ - PTE_READ_ONLY = 0x0000000000000004, /**< Read-Only */ - PTE_EXECUTE = 0x0000000000000008, /**< Execute permission */ - PTE_CACHE_INHIBITED = 0x0000000000000010, /**< Cache-Inhibited Access */ - PTE_MODIFIED = 0x0000000000000020, /**< Page has been modified */ - PTE_ACCESSED = 0x0000000000000040, /**< Page has been accessed */ + PTE_READ = 0x0000000000000004, /**< Read permission */ + PTE_WRITABLE = 0x0000000000000008, /**< Write permission */ + PTE_EXECUTE = 0x0000000000000010, /**< Execute permission */ + PTE_CACHE_INHIBITED = 0x0000000000000020, /**< Cache-Inhibited Access */ + PTE_MODIFIED = 0x0000000000000040, /**< Page has been modified */ + PTE_ACCESSED = 0x0000000000000080, /**< Page has been accessed */ }; /** @@ -96,7 +97,7 @@ class PageTableManager */ static void addEntry( uint64_t i_vAddr, uint64_t i_page, - VmmManager::ACCESS_TYPES i_accessType ); + uint64_t i_accessType ); /** * @brief Remove an entry from the hardware page table @@ -315,7 +316,7 @@ class PageTableManager */ void _addEntry( uint64_t i_vAddr, uint64_t i_page, - VmmManager::ACCESS_TYPES i_accessType ); + uint64_t i_accessType ); /** * @brief Remove an entry from the hardware page table @@ -423,16 +424,16 @@ class PageTableManager * @param[in] i_accessType Access parameter to apply to PTE */ void setAccessBits( PageTableEntry* o_pte, - VmmManager::ACCESS_TYPES i_accessType ); + uint64_t i_accessType ); /** * @brief Convert the bits from a PTE into a ACCESS_TYPES * * @param[in] i_pte PTE to examine * - * @return ACCESS_TYPES Access parameters of given PTE + * @return uint64_t Access parameters of given PTE */ - VmmManager::ACCESS_TYPES getAccessType( const PageTableEntry* i_pte ); + uint64_t getAccessType( const PageTableEntry* i_pte ); /** * @brief Calculate the original Virtual Address from a PTE diff --git a/src/include/kernel/segmentmgr.H b/src/include/kernel/segmentmgr.H index 7232c7d4f..d2e4be2df 100644 --- a/src/include/kernel/segmentmgr.H +++ b/src/include/kernel/segmentmgr.H @@ -57,6 +57,12 @@ class SegmentManager MAX_SEGMENTS = 4 }; + enum + { + CI_ACCESS = 0xFFFFFFFF + // Set to all F's to identify this type + }; + /** * Constructor. Initializes instance variables. */ diff --git a/src/include/kernel/vmmmgr.H b/src/include/kernel/vmmmgr.H index 98b202db1..6e41ddb34 100644 --- a/src/include/kernel/vmmmgr.H +++ b/src/include/kernel/vmmmgr.H @@ -46,15 +46,6 @@ class VmmManager HTABORG = (FULL_MEM_SIZE - PTSIZE), }; - enum ACCESS_TYPES - { - NO_USER_ACCESS, - READ_O_ACCESS, - NORMAL_ACCESS, - CI_ACCESS, - RO_EXE_ACCESS, - }; - enum castout_t { NORMAL, |

