summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Derksen <mderkse1@us.ibm.com>2018-07-16 16:57:08 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-07-23 09:39:24 -0500
commit78c7928126a9ece9cd466be1e0598bf3f082b977 (patch)
tree3f24c2c76e59c66c86d7fe89ec875aab5ad6daf5
parent5ce2333d7d4ac137d389ed5c1ce58795d791ff01 (diff)
downloadtalos-hostboot-78c7928126a9ece9cd466be1e0598bf3f082b977.tar.gz
talos-hostboot-78c7928126a9ece9cd466be1e0598bf3f082b977.zip
Only store HRMOR value on primary node
There is a single field in HDAT where Hostboot fills in an address where PHYP will then write the new HRMOR value any time it changes. The problem is that the independent Hostboot instance in each node is writing the same field with their own node-relative address. There is only 1 field so the last node in will win. Then on the mpipl we won't be able to find it. Change-Id: I18f64816f20b0a3fc2951dff457d9511ca27e1d2 CQ:SW438101 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/62763 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Richard Ward <rward15@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/usr/runtime/populate_hbruntime.C18
-rwxr-xr-xsrc/usr/targeting/targetservicestart.C142
2 files changed, 86 insertions, 74 deletions
diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C
index 5b887022c..28fab3e7d 100644
--- a/src/usr/runtime/populate_hbruntime.C
+++ b/src/usr/runtime/populate_hbruntime.C
@@ -556,14 +556,6 @@ errlHndl_t fill_RsvMem_hbData(uint64_t & io_start_address,
ALIGN_PAGE(l_hbTOC.entry[l_hbTOC.total_entries].size);
l_hbTOC.total_entries++;
- // Fill in HYPCOMM size
- l_hbTOC.entry[l_hbTOC.total_entries].label = Util::HBRT_MEM_LABEL_HYPCOMM;
- l_hbTOC.entry[l_hbTOC.total_entries].offset = 0;
- l_hbTOC.entry[l_hbTOC.total_entries].size = sizeof(hbHypCommArea_t);
- l_totalSectionSize +=
- ALIGN_PAGE(l_hbTOC.entry[l_hbTOC.total_entries].size);
- l_hbTOC.total_entries++;
-
// Fill in VPD_XXXX sizes (if there are any)
VPD::OverrideRsvMemMap_t l_vpdOverrides;
VPD::getListOfOverrideSections( l_vpdOverrides );
@@ -579,7 +571,7 @@ errlHndl_t fill_RsvMem_hbData(uint64_t & io_start_address,
l_hbTOC.total_entries++;
}
- // Fill in the TRACEBUF only for Master Node
+ // Fill in the TRACEBUF & HYPCOMM only for Master Node
if(i_master_node == true )
{
// Fill in TRACEBUF size
@@ -589,6 +581,14 @@ errlHndl_t fill_RsvMem_hbData(uint64_t & io_start_address,
l_totalSectionSize +=
ALIGN_PAGE(l_hbTOC.entry[l_hbTOC.total_entries].size);
l_hbTOC.total_entries++;
+
+ // Fill in HYPCOMM size
+ l_hbTOC.entry[l_hbTOC.total_entries].label = Util::HBRT_MEM_LABEL_HYPCOMM;
+ l_hbTOC.entry[l_hbTOC.total_entries].offset = 0;
+ l_hbTOC.entry[l_hbTOC.total_entries].size = sizeof(hbHypCommArea_t);
+ l_totalSectionSize +=
+ ALIGN_PAGE(l_hbTOC.entry[l_hbTOC.total_entries].size);
+ l_hbTOC.total_entries++;
}
l_totalSectionSize += sizeof(l_hbTOC); // Add 4KB Table of Contents
diff --git a/src/usr/targeting/targetservicestart.C b/src/usr/targeting/targetservicestart.C
index 66b796f22..ab32b3b28 100755
--- a/src/usr/targeting/targetservicestart.C
+++ b/src/usr/targeting/targetservicestart.C
@@ -53,6 +53,7 @@
// This component
#include <targeting/common/targetservice.H>
#include <targeting/attrrp.H>
+#include <targeting/targplatutil.H>
// Others
#include <errl/errlentry.H>
@@ -530,73 +531,84 @@ static void initializeAttributes(TargetService& i_targetService,
membuf->setAttr<ATTR_IBSCOM_VIRTUAL_ADDR>(0);
}
- // Setup physical TOC address
- uint64_t l_hbdTocAddr = AttrRP::getHbDataTocAddr();
-
- // Variables to store information about Hostboot/Hypervisor communcation area
- uint64_t l_hypComm_virt_addr = 0;
- uint64_t l_hypComm_phys_addr = 0;
- uint64_t l_hypComm_size = 0;
-
- // Now map the TOC to find the total size of the data section
- Util::hbrtTableOfContents_t * l_toc_ptr =
- reinterpret_cast<Util::hbrtTableOfContents_t *>(
- mm_block_map(reinterpret_cast<void*>(l_hbdTocAddr),
- ALIGN_PAGE(sizeof(Util::hbrtTableOfContents_t))));
-
- // read the TOC and look for ATTR data section
- l_hypComm_virt_addr = Util::hb_find_rsvd_mem_label(
- Util::HBRT_MEM_LABEL_HYPCOMM,
- l_toc_ptr,
- l_hypComm_size);
-
-
- //This will tell us how far from the beginning of the toc_ptr the hypComm area starts
- uint64_t l_hypComm_offset = l_hypComm_virt_addr - reinterpret_cast<uint64_t>(l_toc_ptr);
-
- //Use the offset found w/ virtual addresses to determine the physical address of the
- //hostboot/hypervisor comm area
- l_hypComm_phys_addr = l_hbdTocAddr + l_hypComm_offset;
-
- // Clear the mapped memory for the TOC, it is not longer needed as we have phys ptr
- assert (0 == mm_block_unmap(reinterpret_cast<void*>(l_toc_ptr)),
- "Failed to unmap hbData TOC");
-
- // The hb/hyp communcation area is at the end of the hostboot
- // data reserved mem section.
- hbHypCommArea_t * l_hbHypComm_ptr =
- reinterpret_cast<hbHypCommArea_t *>(
- mm_block_map(reinterpret_cast<void*>(l_hypComm_phys_addr),
- ALIGN_PAGE(sizeof(l_hypComm_size))));
-
- // Make sure the magic number and version are valid
- if(l_hbHypComm_ptr->magicNum == HYPECOMM_MAGIC_NUM && l_hbHypComm_ptr->version >= STRUCT_VERSION_FIRST)
+ // HYPCOMM section is only present for master node
+ if ( TARGETING::UTIL::isCurrentMasterNode() )
{
- // if the hrmor in the comm area is non-zero then set the payload base attribute
- if( l_hbHypComm_ptr->hrmorAddress)
- {
- const uint64_t THREAD_STATE_RUNNING = 0x8000000000000000ULL;
- TARG_INF("Setting ATTR_PAYLOAD_BASE to new hrmor given by hypervisor: 0x%lx",
- l_hbHypComm_ptr->hrmorAddress);
- //Mask off THREAD_STATE_RUNNING bit and then divide remaining address by 1 MB
- uint64_t l_payloadBase_MB = ((~(THREAD_STATE_RUNNING)) & l_hbHypComm_ptr->hrmorAddress) / MEGABYTE;
- //ATTR_PAYLOAD_BASE's is MB
- l_pTopLevel->setAttr<ATTR_PAYLOAD_BASE>(l_payloadBase_MB);
- }
- else
- {
- TARG_INF("Using default HRMOR as hypervisor did notify us of a change in it's HRMOR on previous boot");
- }
-
- }
- else
- {
- TARG_INF("Warning!! hbHypCommArea_t's version is invalid so we cannot check if hrmor has been changed");
- }
+ // Setup physical TOC address
+ uint64_t l_hbdTocAddr = AttrRP::getHbDataTocAddr();
+
+ // Variables to store information about Hostboot/Hypervisor
+ // communication area
+ uint64_t l_hypComm_virt_addr = 0;
+ uint64_t l_hypComm_phys_addr = 0;
+ uint64_t l_hypComm_size = 0;
+
+ // Now map the TOC to find the total size of the data section
+ Util::hbrtTableOfContents_t * l_toc_ptr =
+ reinterpret_cast<Util::hbrtTableOfContents_t *>(
+ mm_block_map(reinterpret_cast<void*>(l_hbdTocAddr),
+ ALIGN_PAGE(sizeof(Util::hbrtTableOfContents_t))));
+
+ // read the TOC and look for ATTR data section
+ l_hypComm_virt_addr = Util::hb_find_rsvd_mem_label(
+ Util::HBRT_MEM_LABEL_HYPCOMM,
+ l_toc_ptr,
+ l_hypComm_size);
+
+ //This will tell us how far from the beginning of
+ //the toc_ptr the hypComm area starts
+ uint64_t l_hypComm_offset = l_hypComm_virt_addr -
+ reinterpret_cast<uint64_t>(l_toc_ptr);
+
+ //Use the offset found w/ virtual addresses to determine
+ //the physical address of the hostboot/hypervisor comm area
+ l_hypComm_phys_addr = l_hbdTocAddr + l_hypComm_offset;
+
+ //Clear the mapped memory for the TOC,
+ //it is not longer needed as we have phys ptr
+ assert (0 == mm_block_unmap(reinterpret_cast<void*>(l_toc_ptr)),
+ "Failed to unmap hbData TOC");
+
+ // The hb/hyp communcation area is at the end of the hostboot
+ // data reserved mem section.
+ hbHypCommArea_t * l_hbHypComm_ptr =
+ reinterpret_cast<hbHypCommArea_t *>(
+ mm_block_map(reinterpret_cast<void*>(l_hypComm_phys_addr),
+ ALIGN_PAGE(sizeof(l_hypComm_size))));
+
+ // Make sure the magic number and version are valid
+ if( l_hbHypComm_ptr->magicNum == HYPECOMM_MAGIC_NUM &&
+ l_hbHypComm_ptr->version >= STRUCT_VERSION_FIRST )
+ {
+ // if the hrmor in the comm area is non-zero then
+ // set the payload base attribute
+ if( l_hbHypComm_ptr->hrmorAddress)
+ {
+ const uint64_t THREAD_STATE_RUNNING = 0x8000000000000000ULL;
+ TARG_INF("Setting ATTR_PAYLOAD_BASE to new hrmor given by hypervisor: 0x%lx",
+ l_hbHypComm_ptr->hrmorAddress);
+ //Mask off THREAD_STATE_RUNNING bit and
+ //then divide remaining address by 1 MB
+ uint64_t l_payloadBase_MB = ( (~(THREAD_STATE_RUNNING)) &
+ l_hbHypComm_ptr->hrmorAddress) / MEGABYTE;
+ //ATTR_PAYLOAD_BASE's is MB
+ l_pTopLevel->setAttr<ATTR_PAYLOAD_BASE>(l_payloadBase_MB);
+ }
+ else
+ {
+ TARG_INF("Using default HRMOR as hypervisor did notify us of a change in it's HRMOR on previous boot");
+ }
+ }
+ else
+ {
+ TARG_INF("Warning!! hbHypCommArea_t's version is invalid so we cannot check if hrmor has been changed");
+ }
- // Clear the mapped memory for the hbHypComm area
- assert(0 == mm_block_unmap(reinterpret_cast<void*>(l_hbHypComm_ptr)),
- "Failed to unmap hbHypComm area");
+ // Clear the mapped memory for the hbHypComm area
+ assert(0 == mm_block_unmap(
+ reinterpret_cast<void*>(l_hbHypComm_ptr)),
+ "Failed to unmap hbHypComm area");
+ } // end of master node only HRMOR setup
}
else
{
OpenPOWER on IntegriCloud