summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/runtime/runtime.H3
-rw-r--r--src/usr/isteps/istep21/call_host_runtime_setup.C27
-rw-r--r--src/usr/isteps/istep21/call_host_start_payload.C26
-rw-r--r--src/usr/runtime/populate_hbruntime.C28
-rw-r--r--src/usr/sbeio/sbe_memRegionMgr.C7
-rw-r--r--src/usr/sbeio/test/sbe_memregiontest.H11
6 files changed, 70 insertions, 32 deletions
diff --git a/src/include/usr/runtime/runtime.H b/src/include/usr/runtime/runtime.H
index f82bf63fe..017154a1f 100644
--- a/src/include/usr/runtime/runtime.H
+++ b/src/include/usr/runtime/runtime.H
@@ -261,9 +261,10 @@ void rediscover_hdat( void );
/**
* @brief Open necessary unsecure SBE windows for SP -> host communication
- * Currently opens two windows
+ * Currently opens three windows
* 1. CPU controls SP ATTN areas
* 2. SP_HOST_UNTRUSTED_COMM_AREA_ADDR
+ * 3. SBE FFDC
*
* @return errlHndl_t Returns nullptr on success; otherwise errlog
*/
diff --git a/src/usr/isteps/istep21/call_host_runtime_setup.C b/src/usr/isteps/istep21/call_host_runtime_setup.C
index a9dc89305..8140d8f45 100644
--- a/src/usr/isteps/istep21/call_host_runtime_setup.C
+++ b/src/usr/isteps/istep21/call_host_runtime_setup.C
@@ -463,18 +463,6 @@ void* call_host_runtime_setup (void *io_pArgs)
"Successfully sent all system configs to procs via SBE chip op !!");
}
- // Tell SBE to Close All Unsecure Memory Regions
- // @TODO RTC 168745 - Move to istep 21.3 (closer to shutdown)
- l_err = SBEIO::closeAllUnsecureMemRegions();
- if ( l_err )
- {
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "SBEIO::closeAllUnsecureMemRegions Failed" );
- // break from do loop if error occured
- break;
- }
-
-
// Need to load up the runtime module if it isn't already loaded
if ( !VFS::module_is_loaded( "libruntime.so" ) )
{
@@ -687,7 +675,6 @@ void* call_host_runtime_setup (void *io_pArgs)
}
}
-
// Fill in Hostboot runtime data for all nodes
// (adjunct partition)
// Write the HB runtime data into mainstore
@@ -699,20 +686,6 @@ void* call_host_runtime_setup (void *io_pArgs)
// break from do loop if error occurred
break;
}
-
- // Open untrusted SP communication area if there is a PAYLOAD
- // NOTE: Must be after all HDAT processing
- if( !(TARGETING::is_no_load()) )
- {
- l_err = RUNTIME::openUntrustedSpCommArea();
- if (l_err)
- {
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "Failed openUntrustedSpCommArea" );
- break;
- }
- }
-
} while(0);
if( l_err )
diff --git a/src/usr/isteps/istep21/call_host_start_payload.C b/src/usr/isteps/istep21/call_host_start_payload.C
index 772011864..039db3f6f 100644
--- a/src/usr/isteps/istep21/call_host_start_payload.C
+++ b/src/usr/isteps/istep21/call_host_start_payload.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -55,6 +55,8 @@
#include <config.h>
#include <errno.h>
#include <p9_int_scom.H>
+#include <sbeio/sbeioif.H>
+#include <runtime/runtime.H>
#ifdef CONFIG_DRTM_TRIGGERING
#include <secureboot/drtm.H>
@@ -320,6 +322,28 @@ void* call_host_start_payload (void *io_pArgs)
break;
}
+ // Tell SBE to Close All Unsecure Memory Regions
+ l_errl = SBEIO::closeAllUnsecureMemRegions();
+ if (l_errl)
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ ERR_MRK "call_host_start_payload: Failed SBEIO::closeAllUnsecureMemRegions" );
+ break;
+ }
+
+ // Open untrusted SP communication area if there is a PAYLOAD
+ // NOTE: Must be after all HDAT processing
+ if( !(TARGETING::is_no_load()) )
+ {
+ l_errl = RUNTIME::openUntrustedSpCommArea();
+ if (l_errl)
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ ERR_MRK"call_host_start_payload: Failed openUntrustedSpCommArea" );
+ break;
+ }
+ }
+
// - Call shutdown using payload base, and payload entry.
// - base/entry will be from system attributes
// - this will start the payload (Phyp)
diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C
index afd0a6b10..9994f24cc 100644
--- a/src/usr/runtime/populate_hbruntime.C
+++ b/src/usr/runtime/populate_hbruntime.C
@@ -1064,6 +1064,9 @@ errlHndl_t populate_HbRsvMem(uint64_t i_nodeId)
l_prevDataAddr = l_sbeffdcAddr;
l_prevDataSize = l_sbeffdcSizeAligned;
+ // Save SBE FFDC address to attribute
+ l_procChip->setAttr<TARGETING::ATTR_SBE_FFDC_ADDR>(l_sbeffdcAddr);
+
// Open Unsecure Memory Region for SBE FFDC Section
l_elog = SBEIO::openUnsecureMemRegion(l_sbeffdcAddr,
l_sbeffdcSize,
@@ -2383,8 +2386,8 @@ errlHndl_t openUntrustedSpCommArea()
getAllChips(l_procChips, TARGETING::TYPE_PROC);
for (const auto & l_procChip : l_procChips)
{
- // Get Instance ID of proc for trace
- uint32_t l_id = l_procChip->getAttr<TARGETING::ATTR_HBRT_HYP_ID>();
+ // Get HUID of proc for trace
+ auto l_id = TARGETING::get_huid(l_procChip);
// Open SP ATTN region
l_err = SBEIO::openUnsecureMemRegion(l_spAttnStartAddr,
@@ -2417,6 +2420,27 @@ errlHndl_t openUntrustedSpCommArea()
break;
}
}
+
+ // Open Unsecure Memory Region for SBE FFDC Section
+ uint64_t l_sbeffdcAddr =
+ l_procChip->getAttr<TARGETING::ATTR_SBE_FFDC_ADDR>();
+ uint64_t l_sbeffdcSize =
+ SBEIO::SbePsu::getTheInstance().getSbeFFDCBufferSize();
+
+ // Open Unsecure Memory Region for SBE FFDC Section
+ l_err = SBEIO::openUnsecureMemRegion(l_sbeffdcAddr,
+ l_sbeffdcSize,
+ false, //Read-Only
+ l_procChip);
+ if(l_err)
+ {
+ TRACFCOMP( g_trac_runtime, ERR_MRK "openUntrustedSpCommArea(): openUnsecureMemRegion() failed proc = 0x%X addr = 0x%016llx size = 0x%X",
+ l_id,
+ l_sbeffdcAddr,
+ l_sbeffdcSize);
+
+ break;
+ }
}
if(l_err)
{
diff --git a/src/usr/sbeio/sbe_memRegionMgr.C b/src/usr/sbeio/sbe_memRegionMgr.C
index 524c99fbe..a5692549d 100644
--- a/src/usr/sbeio/sbe_memRegionMgr.C
+++ b/src/usr/sbeio/sbe_memRegionMgr.C
@@ -600,6 +600,13 @@ errlHndl_t MemRegionMgr::closeAllUnsecureMemRegions()
l_region.start_addr = itr->start_addr;
l_region.size = itr->size;
l_region.flags = SbePsu::SBE_MEM_REGION_CLOSE;
+ l_region.tgt = itr->tgt;
+
+ // Trace out information of memory region to close
+ SBE_TRACF("closeAllUnsecureMemRegions: Closing Region - tgt=0x%.8X: start_addr=0x%.16llX, size=0x%.8X, flags=0x%.2X",
+ TARGETING::get_huid(l_region.tgt),
+ l_region.start_addr, l_region.size,
+ l_region.flags);
errl = doUnsecureMemRegionOp(l_region);
diff --git a/src/usr/sbeio/test/sbe_memregiontest.H b/src/usr/sbeio/test/sbe_memregiontest.H
index 87cb4a040..f6d0ec634 100644
--- a/src/usr/sbeio/test/sbe_memregiontest.H
+++ b/src/usr/sbeio/test/sbe_memregiontest.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -77,6 +77,15 @@ class SbeMemRegionTest : public CxxTest::TestSuite
do
{
+ // Tell SBE to Close All Unsecure Memory Regions before tests
+ errl = SBEIO::closeAllUnsecureMemRegions();
+ if (errl)
+ {
+ TS_FAIL("memRegionTest1: pre-test cleanup SBEIO::closeAllUnsecureMemRegions Failed: rc=0x%X, plid=0x%X",
+ ERRL_GETRC_SAFE(errl), ERRL_GETPLID_SAFE(errl));
+ break;
+ }
+
// Loop Test: Open MAX+1 to force a fail
for (size_t i = 1; i<=SBEIO_MAX_UNSECURE_MEMORY_REGIONS+1 ; i++)
{
OpenPOWER on IntegriCloud