summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/usr/runtime/runtime_reasoncodes.H4
-rw-r--r--src/include/usr/targeting/attrrp.H10
-rw-r--r--src/include/usr/targeting/common/targreasoncodes.H20
-rw-r--r--src/include/usr/vmmconst.h13
-rw-r--r--src/usr/isteps/istep06/host_discover_targets.C15
-rw-r--r--src/usr/runtime/hdatservice.C16
-rw-r--r--src/usr/runtime/populate_hbruntime.C66
-rwxr-xr-xsrc/usr/targeting/attrrp.C143
-rwxr-xr-xsrc/usr/targeting/attrrp_common.C6
-rw-r--r--src/usr/targeting/runtime/attrrp_rt.C4
-rwxr-xr-xsrc/usr/targeting/targetservicestart.C67
11 files changed, 264 insertions, 100 deletions
diff --git a/src/include/usr/runtime/runtime_reasoncodes.H b/src/include/usr/runtime/runtime_reasoncodes.H
index ad6427668..ab75d4bfd 100644
--- a/src/include/usr/runtime/runtime_reasoncodes.H
+++ b/src/include/usr/runtime/runtime_reasoncodes.H
@@ -53,6 +53,7 @@ namespace RUNTIME
// customize_attrs_for_payload.C
MOD_CUST_COMP_NON_PHYP_RT_TARGET = 0x12,
MOD_CUST_CONF_HBRT_HYP_IDS = 0x13,
+ MOD_POPULATE_RTDATABYNODE = 0x14, /**< populate_hbruntime.C */
};
enum RuntimeReasonCode
@@ -84,7 +85,8 @@ namespace RUNTIME
RC_NOT_ENOUGH_SPACE = RUNTIME_COMP_ID | 0x18,
RT_UNIT_TARGET_NOT_FOUND = RUNTIME_COMP_ID | 0x19,
RT_TARGET_TYPE_NOT_SUPPORTED = RUNTIME_COMP_ID | 0x1A,
- RT_NO_PROC_TARGET = RUNTIME_COMP_ID | 0x1B
+ RT_NO_PROC_TARGET = RUNTIME_COMP_ID | 0x1B,
+ RC_UNMAP_FAIL = RUNTIME_COMP_ID | 0x1C,
};
enum UserDetailsTypes
diff --git a/src/include/usr/targeting/attrrp.H b/src/include/usr/targeting/attrrp.H
index 99b9800ff..429ea3840 100644
--- a/src/include/usr/targeting/attrrp.H
+++ b/src/include/usr/targeting/attrrp.H
@@ -155,7 +155,7 @@ class AttrRP
* reported back through the TaskArgs structure to the init
* service.
*/
- static void init(errlHndl_t& io_taskRetErrl);
+ static void init(errlHndl_t& io_taskRetErrl, bool i_isMpipl = false);
#ifndef __HOSTBOOT_RUNTIME
/**
@@ -193,9 +193,9 @@ class AttrRP
*/
AttrRP()
#ifndef __HOSTBOOT_RUNTIME
- : iv_msgQ(NULL), iv_sections(NULL), iv_sectionCount(0)
+ : iv_msgQ(NULL), iv_sections(NULL), iv_sectionCount(0), iv_isMpipl(false)
#else
- : iv_sections(NULL), iv_sectionCount(0)
+ : iv_sections(NULL), iv_sectionCount(0), iv_isMpipl(false)
#endif
{
};
@@ -258,7 +258,7 @@ class AttrRP
* output, a NULL error log handle on success, or !NULL handle
* on failure
*/
- void startup(errlHndl_t& io_taskRetErrl);
+ void startup(errlHndl_t& io_taskRetErrl, bool i_isMpipl = false);
#ifndef __HOSTBOOT_RUNTIME
@@ -323,6 +323,8 @@ class AttrRP
// Count of attribute sections.
size_t iv_sectionCount;
+
+ bool iv_isMpipl;
};
/**
diff --git a/src/include/usr/targeting/common/targreasoncodes.H b/src/include/usr/targeting/common/targreasoncodes.H
index b26b60d9e..979513cd5 100644
--- a/src/include/usr/targeting/common/targreasoncodes.H
+++ b/src/include/usr/targeting/common/targreasoncodes.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,14 +38,15 @@ namespace TARGETING
enum TargetingModuleId
{
- TARG_MOD_TEST = 0x01,
- TARG_MOD_ATTRRP = 0x02,
- TARG_MOD_ATTR_SYNC = 0x03,
- TARG_RT_GET_RT_TARGET = 0x04,
- TARG_RT_GET_HB_TARGET = 0x05,
- TARG_GET_ATTR_OVER = 0x06,
- TARG_WRITE_PERM_ATTR = 0x07,
-
+ TARG_MOD_TEST = 0x01,
+ TARG_MOD_ATTR_SYNC = 0x02,
+ TARG_RT_GET_RT_TARGET = 0x03,
+ TARG_RT_GET_HB_TARGET = 0x04,
+ TARG_GET_ATTR_OVER = 0x05,
+ TARG_WRITE_PERM_ATTR = 0x06,
+ TARG_PARSE_ATTR_SECT_HEADER = 0x07,
+ TARG_MSG_SERVICE_TASK = 0x08,
+ TARG_CREATE_VMM_SECTIONS = 0x09,
};
enum TargetingReasonCode
@@ -68,6 +69,7 @@ enum TargetingReasonCode
TARG_RC_WRITE_PERM_ATTR_TARGET_FAIL = TARG_COMP_ID | 0x10,
TARG_RC_WRITE_ATTR_OVER_WRONG_PNOR_SEC = TARG_COMP_ID | 0x11,
TARG_RC_WRITE_ATTR_OVER_NO_TANK_LAYER = TARG_COMP_ID | 0x12,
+ TARG_RC_MM_BLOCK_MAP_FAIL = TARG_COMP_ID | 0x13,
};
}; // End TARGETING namespace
diff --git a/src/include/usr/vmmconst.h b/src/include/usr/vmmconst.h
index b155d894f..676e54f5a 100644
--- a/src/include/usr/vmmconst.h
+++ b/src/include/usr/vmmconst.h
@@ -202,14 +202,15 @@ enum BlockPriority
#define VMM_SIZE_RMVPAGE_TEST (8 * PAGESIZE)
/** Chunk of physical memory to use for HostServices Attributes */
-#define HSVC_TEST_MEMORY_ADDR (VMM_MEMORY_SIZE + 32*MEGABYTE)
-#define HSVC_TEST_SYSDATA_SIZE (4*KILOBYTE) /* match FSP HDAT code */
-#define HSVC_TEST_NODEDATA_SIZE (256000) /* match FSP HDAT code */
-#define HSVC_TEST_MEMORY_SIZE \
- ALIGN_PAGE((HSVC_TEST_SYSDATA_SIZE+HSVC_TEST_NODEDATA_SIZE))
+#define MPIPL_ATTR_DATA_ADDR (VMM_MEMORY_SIZE + 32*MEGABYTE)
+#define MPIPL_SYSDATA_SIZE (4*KILOBYTE) /* match FSP HDAT code */
+#define MPIPL_NODEDATA_SIZE (256000) /* match FSP HDAT code */
+#define MPIPL_ATTR_DATA_SIZE \
+ ALIGN_PAGE((MPIPL_SYSDATA_SIZE+MPIPL_NODEDATA_SIZE))
+#define MPIPL_ATTR_VMM_SIZE 0x8001000
/* Chunk of physical memory used for Dump Source Table */
-#define DUMP_TEST_MEMORY_ADDR (HSVC_TEST_MEMORY_ADDR + HSVC_TEST_MEMORY_SIZE)
+#define DUMP_TEST_MEMORY_ADDR (MPIPL_ATTR_DATA_ADDR + MPIPL_ATTR_DATA_SIZE)
#define DUMP_TEST_MEMORY_SIZE (4*MEGABYTE)
/** Location of the TCE Table */
diff --git a/src/usr/isteps/istep06/host_discover_targets.C b/src/usr/isteps/istep06/host_discover_targets.C
index 1bab0216c..36acb9c97 100644
--- a/src/usr/isteps/istep06/host_discover_targets.C
+++ b/src/usr/isteps/istep06/host_discover_targets.C
@@ -164,19 +164,10 @@ void* host_discover_targets( void *io_pArgs )
if (l_pTopLevel->getAttr<TARGETING::ATTR_IS_MPIPL_HB>())
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
- "host_discover_targets: MPIPL mode");
+ "host_discover_targets: MPIPL mode, targeting"
+ "information has already been loaded from memory"
+ "when the targeting service started");
- if(INITSERVICE::spBaseServicesEnabled())
- {
- // Sync attributes from Fsp
- l_err = TARGETING::syncAllAttributesFromFsp();
- }
- else
- {
- //TODO RTC:157651 we need this to be reading from the FSP
- // For now just discover targets the normal way
- l_err = HWAS::discoverTargets();
- }
}
else
{
diff --git a/src/usr/runtime/hdatservice.C b/src/usr/runtime/hdatservice.C
index 7df89c269..88475e0c4 100644
--- a/src/usr/runtime/hdatservice.C
+++ b/src/usr/runtime/hdatservice.C
@@ -269,13 +269,13 @@ errlHndl_t hdatService::get_standalone_section(
if( RUNTIME::HSVC_SYSTEM_DATA == i_section )
{
o_dataAddr = reinterpret_cast<uint64_t>(iv_mem_regions[0].virt_addr);
- o_dataSize = HSVC_TEST_SYSDATA_SIZE;
+ o_dataSize = MPIPL_SYSDATA_SIZE;
}
else if( RUNTIME::HSVC_NODE_DATA == i_section )
{
o_dataAddr = reinterpret_cast<uint64_t>(iv_mem_regions[0].virt_addr)
- + HSVC_TEST_SYSDATA_SIZE;
- o_dataSize = HSVC_TEST_NODEDATA_SIZE;
+ + MPIPL_SYSDATA_SIZE;
+ o_dataSize = MPIPL_NODEDATA_SIZE;
}
else if( RUNTIME::MS_DUMP_SRC_TBL == i_section )
{
@@ -514,12 +514,12 @@ errlHndl_t hdatService::loadHostData(void)
FakePayload::load();
// Map in some arbitrary memory for the HostServices code to use
- TRACFCOMP( g_trac_runtime, "load_host_data> STANDALONE: Mapping in 0x%X-0x%X (%d MB)", HSVC_TEST_MEMORY_ADDR,
- HSVC_TEST_MEMORY_ADDR+HSVC_TEST_MEMORY_SIZE,
- HSVC_TEST_MEMORY_SIZE);
+ TRACFCOMP( g_trac_runtime, "load_host_data> STANDALONE: Mapping in 0x%X-0x%X (%d MB)", MPIPL_ATTR_DATA_ADDR,
+ MPIPL_ATTR_DATA_ADDR+MPIPL_ATTR_DATA_SIZE,
+ MPIPL_ATTR_DATA_SIZE);
- errhdl = mapRegion(HSVC_TEST_MEMORY_ADDR,
- HSVC_TEST_MEMORY_SIZE, l_dummy);
+ errhdl = mapRegion(MPIPL_ATTR_DATA_ADDR,
+ MPIPL_ATTR_DATA_SIZE, l_dummy);
if(errhdl)
{
break;
diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C
index 715ce1e4d..828ca0572 100644
--- a/src/usr/runtime/populate_hbruntime.C
+++ b/src/usr/runtime/populate_hbruntime.C
@@ -47,7 +47,8 @@
#include <sys/internode.h>
#include <vpd/vpd_if.H>
#include <targeting/attrrp.H>
-
+#include <sys/mm.h>
+#include <util/align.H>
namespace RUNTIME
{
@@ -151,6 +152,69 @@ errlHndl_t populate_RtDataByNode(uint64_t iNodeId)
// Get ATTRIBUTE data
TARGETING::AttrRP::save(l_hbrtDataAddr);
+ //Create a block map of memory so we can save a copy of the attribute
+ //data incase we need to MPIPL
+ uint64_t l_attrCopyVmemAddr =
+ reinterpret_cast<uint64_t>(mm_block_map(
+ reinterpret_cast<void*>(MPIPL_ATTR_DATA_ADDR),
+ MPIPL_ATTR_VMM_SIZE ));
+
+ //Make sure the address returned from the block map call is not NULL
+ if(l_attrCopyVmemAddr != 0)
+ {
+ //Save the memory map
+ TARGETING::AttrRP::save(l_attrCopyVmemAddr);
+
+ //Make sure to the virtual address because we won't need it anymore
+ int l_rc = mm_block_unmap(reinterpret_cast<void*>(l_attrCopyVmemAddr));
+
+ if(l_rc)
+ {
+ TRACFCOMP( g_trac_runtime,
+ "populate_RtDataByNode fail to unmap physical addr %p, virt addr %p",
+ reinterpret_cast<void*>(MPIPL_ATTR_DATA_ADDR),
+ reinterpret_cast<void*>(l_attrCopyVmemAddr));
+ /*@ errorlog tag
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid RUNTIME::MOD_POPULATE_RTDATABYNODE
+ * @reasoncode RUNTIME::RC_UNMAP_FAIL
+ * @userdata1 Phys address we are trying to unmap
+ * @userdata2 Virtual address we are trying to unmap
+ *
+ * @devdesc Error unmapping a virtual memory map
+ * @custdesc Kernel failed to unmap memory
+ */
+ l_elog = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ RUNTIME::MOD_POPULATE_RTDATABYNODE,
+ RUNTIME::RC_UNMAP_FAIL,
+ MPIPL_ATTR_DATA_ADDR,
+ l_attrCopyVmemAddr,
+ true);
+ }
+ }
+ else
+ {
+ TRACFCOMP( g_trac_runtime,
+ "populate_RtDataByNode fail to map physical addr %p, size %lx",
+ reinterpret_cast<void*>(MPIPL_ATTR_DATA_ADDR),
+ MPIPL_ATTR_VMM_SIZE );
+ /*@ errorlog tag
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid RUNTIME::MOD_POPULATE_RTDATABYNODE
+ * @reasoncode RUNTIME::RC_CANNOT_MAP_MEMORY
+ * @userdata1 Phys address we are trying to unmap
+ * @userdata2 Size of memory we are trying to map
+ *
+ * @devdesc Error unmapping a virtual memory map
+ * @custdesc Kernel failed to map memory
+ */
+ l_elog = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ RUNTIME::MOD_POPULATE_RTDATABYNODE,
+ RUNTIME::RC_CANNOT_MAP_MEMORY,
+ MPIPL_ATTR_DATA_ADDR,
+ MPIPL_ATTR_VMM_SIZE,
+ true);
+ }
} while(0);
diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C
index 86cd1b748..d0cbda1b1 100755
--- a/src/usr/targeting/attrrp.C
+++ b/src/usr/targeting/attrrp.C
@@ -66,12 +66,13 @@ namespace TARGETING
return NULL;
}
- void AttrRP::startup(errlHndl_t& io_taskRetErrl)
+ void AttrRP::startup(errlHndl_t& io_taskRetErrl, bool i_isMpipl)
{
errlHndl_t l_errl = NULL;
do
{
+ iv_isMpipl = i_isMpipl;
// Parse PNOR headers.
l_errl = this->parseAttrSectHeader();
if (l_errl)
@@ -217,8 +218,8 @@ namespace TARGETING
if (rc != 0)
{
/*@
- * @errortype
- * @moduleid TARG_MOD_ATTRRP
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TARG_MSG_SERVICE_TASK
* @reasoncode TARG_RC_ATTR_MSG_FAIL
* @userdata1 Virtual Address
* @userdata2 (Msg Type << 32) | Section #
@@ -229,10 +230,13 @@ namespace TARGETING
* address outside a valid range or a message
* request that is invalid for the attribute
* section containing the address.
+ *
+ * @custdesc Attribute Resource Provider failed to handle
+ * request
*/
const bool hbSwError = true;
errlHndl_t l_errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
- TARG_MOD_ATTRRP,
+ TARG_MSG_SERVICE_TASK,
TARG_RC_ATTR_MSG_FAIL,
vAddr,
TWO_UINT32_TO_UINT64(
@@ -261,13 +265,58 @@ namespace TARGETING
{
// Locate attribute section in PNOR.
PNOR::SectionInfo_t l_pnorSectionInfo;
+ TargetingHeader* l_header = nullptr;
l_errl = PNOR::getSectionInfo(PNOR::HB_DATA,
l_pnorSectionInfo);
if (l_errl) break;
-
- // Find attribute section header.
- TargetingHeader* l_header =
+ if(!iv_isMpipl)
+ {
+ // Find attribute section header.
+ l_header =
reinterpret_cast<TargetingHeader*>(l_pnorSectionInfo.vaddr);
+ }
+ else
+ {
+ TRACFCOMP(g_trac_targeting,
+ "Reading attributes from memory, NOT PNOR");
+ //Create a block map of the address space we used to store
+ //attribute information on the initial IPL
+ l_header = reinterpret_cast<TargetingHeader*>(
+ mm_block_map(reinterpret_cast<void*>(MPIPL_ATTR_DATA_ADDR),
+ MPIPL_ATTR_VMM_SIZE));
+ if(l_header == 0)
+ {
+ TRACFCOMP(g_trac_targeting,
+ "Failed mapping phys addr: %p for %lx bytes",
+ MPIPL_ATTR_DATA_ADDR,
+ MPIPL_ATTR_VMM_SIZE);
+ //Error mm_block_map returned invalid ptr
+ /*@
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TARG_PARSE_ATTR_SECT_HEADER
+ * @reasoncode TARG_RC_MM_BLOCK_MAP_FAIL
+ * @userdata1 physical address of target info
+ * @userdata2 size we tried to map
+ *
+ * @devdesc While attempting to map a phys addr to a virtual
+ * addr for our targeting information the kernel
+ * returned an error
+ * @custdesc Kernel failed to block map memory
+ */
+ l_errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
+ TARG_PARSE_ATTR_SECT_HEADER,
+ TARG_RC_MM_BLOCK_FAIL,
+ MPIPL_ATTR_DATA_ADDR,
+ MPIPL_ATTR_VMM_SIZE,
+ true);
+ break;
+ }
+ TRACFCOMP(g_trac_targeting,
+ "Mapped phys addr: %p to virt addr: %p",
+ reinterpret_cast<void*>(MPIPL_ATTR_DATA_ADDR),
+ l_header);
+ }
+
// Validate eye catch.
if (l_header->eyeCatcher != PNOR_TARG_EYE_CATCHER)
@@ -278,8 +327,8 @@ namespace TARGETING
l_header->eyeCatcher,
PNOR_TARG_EYE_CATCHER);
/*@
- * @errortype
- * @moduleid TARG_MOD_ATTRRP
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TARG_PARSE_ATTR_SECT_HEADER
* @reasoncode TARG_RC_BAD_EYECATCH
* @userdata1 Observed Header Eyecatch Value
* @userdata2 Expected Eyecatch Value
@@ -297,7 +346,7 @@ namespace TARGETING
* to be parsed.
*/
l_errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
- TARG_MOD_ATTRRP,
+ TARG_PARSE_ATTR_SECT_HEADER,
TARG_RC_BAD_EYECATCH,
l_header->eyeCatcher,
PNOR_TARG_EYE_CATCHER);
@@ -308,13 +357,28 @@ namespace TARGETING
iv_sectionCount = l_header->numSections;
iv_sections = new AttrRP_Section[iv_sectionCount];
- // Find start to first section:
- // (PNOR addr + size of header + offset in header).
- TargetingSection* l_section =
+ TargetingSection* l_section = nullptr;
+ if(!iv_isMpipl)
+ {
+ // Find start to first section:
+ // (PNOR addr + size of header + offset in header).
+ l_section =
+ reinterpret_cast<TargetingSection*>(
+ l_pnorSectionInfo.vaddr + sizeof(TargetingHeader) +
+ l_header->offsetToSections
+ );
+ }
+ else
+ {
+ // Find start to first section:
+ // (header address + size of header + offset in header)
+ l_section =
reinterpret_cast<TargetingSection*>(
- l_pnorSectionInfo.vaddr + sizeof(TargetingHeader) +
- l_header->offsetToSections
- );
+ reinterpret_cast<uint64_t>(l_header) +
+ sizeof(TargetingHeader) + l_header->offsetToSections
+ );
+
+ }
// Parse each section.
for (size_t i = 0; i < iv_sectionCount; i++, ++l_section)
@@ -329,8 +393,16 @@ namespace TARGETING
static_cast<uint64_t>(
TARG_TO_PLAT_PTR(l_header->vmmBaseAddress)) +
l_header->vmmSectionOffset*i;
- iv_sections[i].pnorAddress = l_pnorSectionInfo.vaddr +
- l_section->sectionOffset;
+ if(!iv_isMpipl)
+ {
+ iv_sections[i].pnorAddress = l_pnorSectionInfo.vaddr + l_section->sectionOffset;
+ }
+ else
+ {
+ //For MPIPL we are reading from real memory, not pnor flash. Set the real memory address
+ //in place of the pnor address because that is where we are reading the data from
+ iv_sections[i].pnorAddress = reinterpret_cast<uint64_t>(l_header) + l_section->sectionOffset;
+ }
iv_sections[i].size = l_section->sectionSize;
TRACFCOMP(g_trac_targeting,
@@ -383,16 +455,17 @@ namespace TARGETING
default:
/*@
- * @errortype
- * @moduleid TARG_MOD_ATTRRP
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TARG_CREATE_VMM_SECTIONS
* @reasoncode TARG_RC_UNHANDLED_ATTR_SEC_TYPE
* @userdata1 Section type
*
* @devdesc Found unhandled attribute section type
+ * @custdesc FW error, unexpected Attribute section type
*/
const bool hbSwError = true;
l_errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
- TARG_MOD_ATTRRP,
+ TARG_CREATE_VMM_SECTIONS,
TARG_RC_UNHANDLED_ATTR_SEC_TYPE,
iv_sections[i].type,
0, hbSwError);
@@ -420,8 +493,8 @@ namespace TARGETING
if (rc)
{
/*@
- * @errortype
- * @moduleid TARG_MOD_ATTRRP
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TARG_CREATE_VMM_SECTIONS
* @reasoncode TARG_RC_MM_BLOCK_FAIL
* @userdata1 vAddress attempting to allocate.
* @userdata2 RC from kernel.
@@ -429,10 +502,11 @@ namespace TARGETING
* @devdesc While attempting to allocate a virtual
* memory block for an attribute section, the
* kernel returned an error.
+ * @custdesc Kernel failed to block memory
*/
const bool hbSwError = true;
l_errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
- TARG_MOD_ATTRRP,
+ TARG_CREATE_VMM_SECTIONS,
TARG_RC_MM_BLOCK_FAIL,
iv_sections[i].vmmAddress,
rc, hbSwError);
@@ -441,6 +515,8 @@ namespace TARGETING
if(iv_sections[i].type == SECTION_TYPE_PNOR_RW)
{
+ // TODO RTC:164480 For MPIPL we need to map the RW section
+ // in real memory to virtual address of the section in PNOR
/*
* Register this memory range to be FLUSHed during
* a shutdown.
@@ -458,8 +534,8 @@ namespace TARGETING
if (rc)
{
/*@
- * @errortype
- * @moduleid TARG_MOD_ATTRRP
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TARG_CREATE_VMM_SECTIONS
* @reasoncode TARG_RC_MM_PERM_FAIL
* @userdata1 vAddress attempting to allocate.
* @userdata2 (kernel-rc << 32) | (Permissions)
@@ -467,10 +543,13 @@ namespace TARGETING
* @devdesc While attempting to set permissions on
* a virtual memory block for an attribute
* section, the kernel returned an error.
+ *
+ * @custdesc Kernel failed to set permissions on
+ * virtual memory block
*/
const bool hbSwError = true;
l_errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
- TARG_MOD_ATTRRP,
+ TARG_CREATE_VMM_SECTIONS,
TARG_RC_MM_PERM_FAIL,
iv_sections[i].vmmAddress,
TWO_UINT32_TO_UINT64(rc, l_perm),
@@ -478,6 +557,16 @@ namespace TARGETING
break;
}
+ // The volatile sections in MPIPL need to be copied because
+ // on the MPIPL flow we will not run the HWPs that set these attrs
+ if(((iv_sections[i].type == SECTION_TYPE_HEAP_ZERO_INIT) ||
+ (iv_sections[i].type == SECTION_TYPE_HB_HEAP_ZERO_INIT)) &&
+ iv_isMpipl)
+ {
+ memcpy(reinterpret_cast<void*>(iv_sections[i].vmmAddress),
+ reinterpret_cast<void*>(iv_sections[i].pnorAddress),
+ (iv_sections[i].size));
+ }
} // End iteration through each section
if(l_errl)
diff --git a/src/usr/targeting/attrrp_common.C b/src/usr/targeting/attrrp_common.C
index 69810898d..07df1b1e3 100755
--- a/src/usr/targeting/attrrp_common.C
+++ b/src/usr/targeting/attrrp_common.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2015 */
+/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -59,10 +59,10 @@ namespace TARGETING
TARG_ASSERT(false, "Assert to exit ~AttrRP");
}
- void AttrRP::init(errlHndl_t &io_taskRetErrl)
+ void AttrRP::init(errlHndl_t &io_taskRetErrl, bool i_isMpipl)
{
// Call startup on singleton instance.
- Singleton<AttrRP>::instance().startup(io_taskRetErrl);
+ Singleton<AttrRP>::instance().startup(io_taskRetErrl, i_isMpipl);
}
bool AttrRP::writeSectionData(
diff --git a/src/usr/targeting/runtime/attrrp_rt.C b/src/usr/targeting/runtime/attrrp_rt.C
index dde880cc0..cf4370f05 100644
--- a/src/usr/targeting/runtime/attrrp_rt.C
+++ b/src/usr/targeting/runtime/attrrp_rt.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2015 */
+/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -36,7 +36,7 @@ using namespace ERRORLOG;
namespace TARGETING
{
- void AttrRP::startup(errlHndl_t& io_taskRetErrl)
+ void AttrRP::startup(errlHndl_t& io_taskRetErrl, bool isMpipl)
{
errlHndl_t l_errl = NULL;
diff --git a/src/usr/targeting/targetservicestart.C b/src/usr/targeting/targetservicestart.C
index 073f70eb5..89874132b 100755
--- a/src/usr/targeting/targetservicestart.C
+++ b/src/usr/targeting/targetservicestart.C
@@ -78,7 +78,10 @@ namespace TARGETING
/*
* @brief Initialize any attributes that need to be set early on
*/
-static void initializeAttributes(TargetService& i_targetService);
+static void initializeAttributes(TargetService& i_targetService,
+ bool i_isMpipl,
+ bool i_istepMode,
+ ATTR_MASTER_MBOX_SCRATCH_type& i_masterScratch);
/**
* @brief Check that at least one processor of our cpu type is being targeted
@@ -101,14 +104,41 @@ static void initTargeting(errlHndl_t& io_pError)
TARG_ENTER();
- AttrRP::init(io_pError);
+ //Need to stash away the master mbox regs as they will
+ //be overwritten
+ bool l_isMpipl = false;
+ bool l_isIstepMode = false;
+ ATTR_MASTER_MBOX_SCRATCH_type l_scratch = {0,0,0,0,0,0,0,0};
+
+ for(size_t i=0; i< sizeof(l_scratch)/sizeof(l_scratch[0]); i++)
+ {
+ l_scratch[i] =
+ Util::readScratchReg(MBOX_SCRATCH_REG1+i);
+ }
+
+ // Check mbox scratch reg 3 for IPL boot options
+ // Specifically istep mode (bit 0) and MPIPL (bit 2)
+ INITSERVICE::SPLESS::MboxScratch3_t l_scratch3;
+ l_scratch3.data32 = l_scratch[SCRATCH_3];
+
+ if(l_scratch3.isMpipl)
+ {
+ TARG_INF("We are running MPIPL mode");
+ l_isMpipl = true;
+ }
+ if(l_scratch3.istepMode)
+ {
+ l_isIstepMode = true;
+ }
+
+ AttrRP::init(io_pError, l_isMpipl);
if (io_pError == NULL)
{
TargetService& l_targetService = targetService();
(void)l_targetService.init();
- initializeAttributes(l_targetService);
+ initializeAttributes(l_targetService, l_isMpipl, l_isIstepMode, l_scratch);
checkProcessorTargeting(l_targetService);
// Print out top-level model value from loaded targeting values.
@@ -209,12 +239,14 @@ static void checkProcessorTargeting(TargetService& i_targetService)
/*
* @brief Initialize any attributes that need to be set early on
*/
-static void initializeAttributes(TargetService& i_targetService)
+static void initializeAttributes(TargetService& i_targetService,
+ bool i_isMpipl,
+ bool i_istepMode,
+ ATTR_MASTER_MBOX_SCRATCH_type& i_masterScratch)
{
#define TARG_FN "initializeAttributes()...)"
TARG_ENTER();
- bool l_isMpipl = false;
Target* l_pTopLevel = NULL;
i_targetService.getTopLevelTarget(l_pTopLevel);
@@ -244,36 +276,17 @@ static void initializeAttributes(TargetService& i_targetService)
l_pMasterProcChip->setAttr<ATTR_I2C_SWITCHES>(l_i2c_switches);
- //Need to stash away the master mbox regs as they will
- //be overwritten
- ATTR_MASTER_MBOX_SCRATCH_type l_scratch;
- for(size_t i=0; i< sizeof(l_scratch)/sizeof(l_scratch[0]); i++)
- {
- l_scratch[i] =
- Util::readScratchReg(MBOX_SCRATCH_REG1+i);
- }
-
- l_pTopLevel->setAttr<ATTR_MASTER_MBOX_SCRATCH>(l_scratch);
-
- // Check mbox scratch reg 3 for IPL boot options
- // Specifically istep mode (bit 0) and MPIPL (bit 2)
- INITSERVICE::SPLESS::MboxScratch3_t l_scratch3;
- l_scratch3.data32 = l_scratch[SCRATCH_3];
+ l_pTopLevel->setAttr<ATTR_MASTER_MBOX_SCRATCH>(i_masterScratch);
// Targeting data defaults to non istep, only turn "on" if bit
// is set so we don't tromp default setting
- if (l_scratch3.istepMode)
+ if (i_istepMode)
{
l_pTopLevel->setAttr<ATTR_ISTEP_MODE>(1);
}
-
- if (l_scratch3.isMpipl)
- {
- l_isMpipl = true;
- }
}
- if(l_isMpipl)
+ if(i_isMpipl)
{
l_pTopLevel->setAttr<ATTR_IS_MPIPL_HB>(1);
}
OpenPOWER on IntegriCloud