summaryrefslogtreecommitdiffstats
path: root/src/usr/runtime
diff options
context:
space:
mode:
authorChristian Geddes <crgeddes@us.ibm.com>2017-12-13 19:49:24 -0600
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2017-12-21 14:04:31 -0500
commitaedc6f0a892ea06344af32293d8d2f5d8b248369 (patch)
tree9649aac83287f4a4b9cee50ef632ab11cc723041 /src/usr/runtime
parent779a1c3444a348e7eccbf587ded6041cc3bbd13d (diff)
downloadtalos-hostboot-aedc6f0a892ea06344af32293d8d2f5d8b248369.tar.gz
talos-hostboot-aedc6f0a892ea06344af32293d8d2f5d8b248369.zip
Add comments for hb/hypervisor communication struct and remove TODO
Add comments from a previous review and also removed TODOs now that hdat code is in backing build Change-Id: Ibf561fdfd7a61b66611a065d77a73fc81dd4e7e7 RTC: 180959 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50907 Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@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: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/runtime')
-rw-r--r--src/usr/runtime/hdatstructs.H12
-rw-r--r--src/usr/runtime/populate_hbruntime.C12
2 files changed, 17 insertions, 7 deletions
diff --git a/src/usr/runtime/hdatstructs.H b/src/usr/runtime/hdatstructs.H
index 41cbd1b19..78c057fde 100644
--- a/src/usr/runtime/hdatstructs.H
+++ b/src/usr/runtime/hdatstructs.H
@@ -394,14 +394,24 @@ const uint64_t HYPECOMM_MAGIC_NUM = 0x48595045434f4d4d;
// (offset to start of data in hbHypCommArea_t struct)
const uint8_t HYPCOMM_STRUCT_HRMOR_OFFSET = 24;
+
+//Note when adding data to this make sure to add at the bottom
+//and keep this struct 8 byte aligned
+// We never want to change the format of the first 24 bytes of this struct
struct hbHypCommArea_t
{
uint64_t magicNum; // 8 bytes 0x48595045434f4d4d = HYPECOMM
size_t size; // 8 bytes
- uint32_t version; // 4 bytes
+ uint32_t version; // 4 bytes keep track of version so we can set the size correctly
uint8_t padding[4]; // 4 bytes put padding in so hrmor is 8 byte aligned
//Start Data // 0x18 or 24 byte offset to data
+ //
+ //The space allocated for HRMOR address can be written to by the hypervisor
+ //in the event that the hypervisor changes its hrmor. This will allow
+ //hostboot to know where to load the payload on MPIPL.
uint64_t hrmorAddress; // 8 bytes
+
+ //Total = 32 bytes
hbHypCommArea_t(): magicNum(HYPECOMM_MAGIC_NUM), size(HB_HYP_COMM_STRUCT_SIZES[STRUCT_VERSION_LATEST]),
version(STRUCT_VERSION_LATEST), padding{0,0,0,0}, hrmorAddress(0)
{
diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C
index e22e4fa04..f4d69694c 100644
--- a/src/usr/runtime/populate_hbruntime.C
+++ b/src/usr/runtime/populate_hbruntime.C
@@ -533,11 +533,12 @@ errlHndl_t fill_RsvMem_hbData(uint64_t & io_start_address,
= sys->getAttr<TARGETING::ATTR_PAYLOAD_KIND>();
hbHypCommArea_t l_hbCommArea;
+ static_assert((sizeof(hbHypCommArea_t) % 8) == 0,
+ "hbHypCommArea_t's size must be 8 byte aligned");
uint64_t l_hdatPtrToHrmorStashAddr = 0;
size_t l_hdatPtrHrmorStashSize = 0;
- //TODO RTC 180959 enable this when HDAT has added in HRMOR ptr space in MS Addr Config section of HDAT
-// uint64_t * l_pHdatPtrToHrmorStashAddr;
-// memcpy a copy of the hbHypCommArea struct to the end of the hbData section
+ uint64_t * l_pHdatPtrToHrmorStashAddr;
+ // memcpy a copy of the hbHypCommArea struct into the reserved mem area
memcpy( reinterpret_cast<void*>(l_prevDataAddr),
reinterpret_cast<void*>(&l_hbCommArea),
sizeof(hbHypCommArea_t));
@@ -564,12 +565,11 @@ errlHndl_t fill_RsvMem_hbData(uint64_t & io_start_address,
sizeof(uint64_t), l_hdatPtrHrmorStashSize);
//Cast the value returned from get_host_data_section to a uint64_t pointer
- // l_pHdatPtrToHrmorStashAddr = reinterpret_cast<uint64_t *>(l_hdatPtrToHrmorStashAddr);
+ l_pHdatPtrToHrmorStashAddr = reinterpret_cast<uint64_t *>(l_hdatPtrToHrmorStashAddr);
- //TODO RTC 180959 enable this when HDAT has added in HRMOR ptr space in MS Addr Config section of HDAT
//Set the value of the pointer to be the physical address
//of the hrmor stash in the hb-hyp communication area
- // *l_pHdatPtrToHrmorStashAddr = io_start_address + l_hbTOC.entry[i].offset + HYPCOMM_STRUCT_HRMOR_OFFSET;
+ *l_pHdatPtrToHrmorStashAddr = io_start_address + l_hbTOC.entry[i].offset + HYPCOMM_STRUCT_HRMOR_OFFSET;
TRACFCOMP( g_trac_runtime,
"fill_RsvMem_hbData> HYPCOMM v address 0x%.16llX, size: %lld done",
OpenPOWER on IntegriCloud