diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2011-03-27 17:09:51 -0500 |
---|---|---|
committer | Patrick Williams <iawillia@us.ibm.com> | 2011-03-27 17:11:18 -0500 |
commit | ee22bb572a701ba2e172d1f95a306f880e38c2cc (patch) | |
tree | 6a38a08af183ed470670642469d3e30014311bd8 /src | |
parent | d6570a2964cca62323ac6ca19b5d25973f73f45b (diff) | |
download | talos-hostboot-ee22bb572a701ba2e172d1f95a306f880e38c2cc.tar.gz talos-hostboot-ee22bb572a701ba2e172d1f95a306f880e38c2cc.zip |
Make VMM more resilient to different image sizes.
Diffstat (limited to 'src')
-rw-r--r-- | src/include/kernel/vmmmgr.H | 8 | ||||
-rw-r--r-- | src/kernel/vmmmgr.C | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/include/kernel/vmmmgr.H b/src/include/kernel/vmmmgr.H index adf699e85..4fc378578 100644 --- a/src/include/kernel/vmmmgr.H +++ b/src/include/kernel/vmmmgr.H @@ -14,7 +14,9 @@ class VmmManager enum VMM_CONSTS { - FULL_MEM_SIZE = 8 * 1024 * 1024, + EIGHT_MEG = 8 * 1024 * 1024, + + FULL_MEM_SIZE = 1 * EIGHT_MEG, PAGESIZE = 4096, PTSIZE = (1 << 18), @@ -34,8 +36,8 @@ class VmmManager enum PID_ALLOCATIONS { - LinearSpace = 0, - MMIOSpace = 1, + LinearSpace = (FULL_MEM_SIZE / EIGHT_MEG) - 1, + MMIOSpace = LinearSpace + 1, FirstPid, }; diff --git a/src/kernel/vmmmgr.C b/src/kernel/vmmmgr.C index f47b92059..34806a19b 100644 --- a/src/kernel/vmmmgr.C +++ b/src/kernel/vmmmgr.C @@ -79,9 +79,9 @@ void VmmManager::initPTEs() { access = READ_O_ACCESS; } - volatile pte_t& pte = getPte(i, 0); + volatile pte_t& pte = getPte(i % PTEG_COUNT, i / PTEG_COUNT); defaultPte(pte); - setTid(LinearSpace, pte); + setTid(i / PTEG_COUNT, pte); setAccess(access, pte); setPage(i, pte); setValid(true, pte); @@ -106,7 +106,7 @@ bool VmmManager::_pteMiss(task_t* t) uint64_t effPid = effAddr / FULL_MEM_SIZE; - if (effPid == LinearSpace) + if (effPid <= LinearSpace) { lock.unlock(); return false; // Should not get this exception in Linear space |