summaryrefslogtreecommitdiffstats
path: root/src/usr/mbox
diff options
context:
space:
mode:
authorcrgeddes <crgeddes@us.ibm.com>2015-11-12 17:07:14 -0600
committerPatrick Williams <iawillia@us.ibm.com>2015-12-11 15:30:29 -0600
commitc1f7932eae885dda2f333c6817e03294f1cdb1ae (patch)
tree5e5e534157decbad9af7c6f5cf07c914ff3f4989 /src/usr/mbox
parent38fb2f757c35568df4a969def6bedf6c0a23aa64 (diff)
downloadtalos-hostboot-c1f7932eae885dda2f333c6817e03294f1cdb1ae.tar.gz
talos-hostboot-c1f7932eae885dda2f333c6817e03294f1cdb1ae.zip
Remove "secure" memory need for DMA Buffer
Change-Id: If2e5511a8cdfeb29f261c4e76e0d52f52ad7226b Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22013 Reviewed-by: PRACHI GUPTA <pragupta@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: WILLIAM G. HOFFA <wghoffa@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/mbox')
-rw-r--r--src/usr/mbox/mbox_dma_buffer.C47
-rw-r--r--src/usr/mbox/mbox_dma_buffer.H5
2 files changed, 5 insertions, 47 deletions
diff --git a/src/usr/mbox/mbox_dma_buffer.C b/src/usr/mbox/mbox_dma_buffer.C
index dd372eccc..7a8cc4d2c 100644
--- a/src/usr/mbox/mbox_dma_buffer.C
+++ b/src/usr/mbox/mbox_dma_buffer.C
@@ -31,6 +31,7 @@
#include <kernel/misc.H>
#include <targeting/common/targetservice.H>
+
#define ALIGN_DMAPAGE(u) (((u) + (VmmManager::MBOX_DMA_PAGESIZE-1)) & \
~(VmmManager::MBOX_DMA_PAGESIZE-1))
@@ -44,9 +45,10 @@ DmaBuffer::DmaBuffer() :
iv_dir(makeMask(VmmManager::MBOX_DMA_PAGES)),
iv_dma_req_sent(false)
{
- iv_head = reinterpret_cast<void*>(VmmManager::MBOX_DMA_ADDR);
- // RTC:137627 - remove for P9 bringup
- //initPhysicalArea(iv_head, iv_phys_head);
+ iv_head = malloc(VmmManager::MBOX_DMA_SIZE);
+
+ iv_phys_head = mm_virt_to_phys(iv_head);
+ memset(iv_head, '\0', VmmManager::MBOX_DMA_SIZE);
}
@@ -164,42 +166,3 @@ uint64_t DmaBuffer::makeMask(uint64_t i_size)
return mask;
}
-void DmaBuffer::initPhysicalArea(void*& io_addr, uint64_t& o_phys)
-{
- // Get the original physical address (includes HRMOR).
- o_phys = mm_virt_to_phys(io_addr);
-
- // Remove original address from VMM maps.
- mm_set_permission(io_addr, VmmManager::MBOX_DMA_SIZE, NO_ACCESS);
-
- // Find the amount of the node offset.
- TARGETING::Target * sys = NULL;
- TARGETING::targetService().getTopLevelTarget( sys );
- assert(sys != NULL);
- uint64_t hrmor_base =
- sys->getAttr<TARGETING::ATTR_HB_HRMOR_NODAL_BASE>();
-
- // Move the physical address to the start of the node (unsecure) and
- // add on the DMA buffer offset inside the node.
- o_phys &= ~(hrmor_base-1);
- o_phys += reinterpret_cast<uint64_t>(io_addr) +
- VMM_UNSECURE_RESERVED_MEMORY_BASEADDR;
-
- // Allocate a new VMM block for the buffer.
- io_addr = mm_guarded_block_map(reinterpret_cast<void*>(o_phys),
- VmmManager::MBOX_DMA_SIZE);
- // Note: We do not plan on deleting this block, even when the buffer
- // is destructed, because we have fundamentally changed the
- // underlying memory by populating the addresses in a different
- // physical location (see populate_cache_lines call below).
-
- // Populate cache lines in unsecure memory.
- KernelMisc::populate_cache_lines(
- reinterpret_cast<uint64_t*>(io_addr),
- reinterpret_cast<uint64_t*>(VmmManager::MBOX_DMA_SIZE +
- reinterpret_cast<uint64_t>(io_addr)));
-
- memset(io_addr, '\0', VmmManager::MBOX_DMA_SIZE);
-
-}
-
diff --git a/src/usr/mbox/mbox_dma_buffer.H b/src/usr/mbox/mbox_dma_buffer.H
index 193ee34c8..acb18df1f 100644
--- a/src/usr/mbox/mbox_dma_buffer.H
+++ b/src/usr/mbox/mbox_dma_buffer.H
@@ -168,11 +168,6 @@ namespace MBOX
*/
static uint64_t makeMask(uint64_t i_size);
- /**
- * Perform VMM operations to allocate physical area in unsecure
- * region of memory.
- */
- void initPhysicalArea(void*& io_addr, uint64_t& o_phys);
enum
{
OpenPOWER on IntegriCloud