diff options
| author | Missy Connell <missyc@us.ibm.com> | 2012-09-10 16:05:01 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-10-09 17:10:32 -0500 |
| commit | 1bf8c6b8376efacd03e3ec62d5ded5b2be4bff39 (patch) | |
| tree | c266815232142e67f15a61ffcbdf09407737f259 /src/kernel/block.C | |
| parent | fb1836fd7b1b8839815595db08ae740ec7b86347 (diff) | |
| download | talos-hostboot-1bf8c6b8376efacd03e3ec62d5ded5b2be4bff39.tar.gz talos-hostboot-1bf8c6b8376efacd03e3ec62d5ded5b2be4bff39.zip | |
Extend VMM to 32M
Add mmLinearMap to create block at a specified phys addr.
Added iv_MaptoPhy in the block to indicate we are physically mapped
block and to not apply the HRMOR.
Change-Id: I75ddb19b82ae9a2035ff873edff8a34a33c74639
RTC:43401
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1846
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/kernel/block.C')
| -rw-r--r-- | src/kernel/block.C | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/kernel/block.C b/src/kernel/block.C index 1ea12d2c0..c8546f760 100644 --- a/src/kernel/block.C +++ b/src/kernel/block.C @@ -39,6 +39,8 @@ #include <kernel/basesegment.H> #include <arch/ppc.H> +#include <new> + // Track eviction requests due to aging pages uint32_t Block::cv_ro_evict_req = 0; uint32_t Block::cv_rw_evict_req = 0; @@ -58,10 +60,21 @@ Block::~Block() } } -void Block::init(MessageQueue* i_msgQ) +void Block::init(MessageQueue* i_msgQ, uint64_t *i_spteAddr) { - // Create a shadow PTE for each page. - iv_ptes = new ShadowPTE[iv_size / PAGESIZE]; + + if (i_spteAddr == NULL) + { + // Create a shadow PTE for each page. + iv_ptes = new ShadowPTE[iv_size / PAGESIZE]; + } + else // set the page table to reside at the address requested + { + // Doing a placement new to put the SPTE at the beginging + // of the block we allocated. + iv_ptes = new(i_spteAddr) ShadowPTE[iv_size / PAGESIZE]; + } + if (i_msgQ != NULL) { //Create message handler to handle read operations for this block @@ -265,7 +278,12 @@ uint64_t Block::findPhysicalAddress(uint64_t i_vaddr) const { paddr = pte->getPageAddr(); paddr += i_vaddr % PAGESIZE; - paddr |= getHRMOR(); + + // If not a physically mapped block then add HRMOR + if (!iv_mappedToPhysical) + { + paddr |= getHRMOR(); + } } return paddr; |

