summaryrefslogtreecommitdiffstats
path: root/src/usr/runtime
diff options
context:
space:
mode:
authorJaymes Wilks <mjwilks@us.ibm.com>2018-06-08 09:00:12 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2018-06-21 15:52:02 -0400
commit24f3312ea1d3d45feca870c7c919bcbd69ef0ff4 (patch)
tree120b1a9a38c0002f33de17d070cce41070c6c2f0 /src/usr/runtime
parentccf2f3445e15a93f06528c5f077c34e5abce548b (diff)
downloadtalos-hostboot-24f3312ea1d3d45feca870c7c919bcbd69ef0ff4.tar.gz
talos-hostboot-24f3312ea1d3d45feca870c7c919bcbd69ef0ff4.zip
HRMOR relative addressing for PHyp SP ATTN area dump
This change adds absolute addresses to HDAT for the SP ATTN area that the PHyp team can now use for predictably locating PHyp debug information. In addition, Hostboot now populates attributes with its intended PHyp ATTN area start addresses for FSP to read. Change-Id: I21fbdf672c37462c87705236973b22f9d1d4eba4 CMVC-Prereq: 1059060 CMVC-Prereq: 1058912 CMVC-Prereq: 1059317 RTC:186439 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59269 Reviewed-by: Nicholas E. Bofferding <bofferdn@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: Michael Baiocchi <mbaiocch@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-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/populate_hbruntime.C68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C
index 7672a572a..db2fa42c7 100644
--- a/src/usr/runtime/populate_hbruntime.C
+++ b/src/usr/runtime/populate_hbruntime.C
@@ -3403,6 +3403,74 @@ errlHndl_t openUntrustedSpCommArea(const uint64_t i_commBase)
l_spAttnStartAddr,
l_spAttnCombinedSize);
+ // If in phyp mode and the master
+ if (TARGETING::is_phyp_load() && TARGETING::UTIL::isCurrentMasterNode())
+ {
+ // make sure ATTN area never grows beyond the SP/PHyp untrusted region
+ if (l_spAttnCombinedSize > SP_HOST_ATTN_SIZE_LIMIT)
+ {
+ TRACFCOMP( g_trac_runtime,
+ ERR_MRK"openUntrustedSpCommArea(): Combined sizes of SP ATTN area 1 and area 2 are larger than 0x%.16llX. ATTN1 sz: 0x%.16llX, ATTN2 sz: 0x%.16llX",
+ SP_HOST_ATTN_SIZE_LIMIT,
+ l_pCpuCtrlInfo->spAttnArea1.size,
+ l_pCpuCtrlInfo->spAttnArea2.size);
+
+ /*@
+ * @errortype
+ * @moduleid RUNTIME::MOD_OPEN_UNTRUSTED_SP_AREAS
+ * @reasoncode RUNTIME::RC_SP_ATTN_AREA_OVERFLOW
+ * @userdata1 SP ATTN Area total size
+ * @userdata2 SP ATTN Area start address
+ * @devdesc SP ATTN Areas attempting to allocate past valid
+ * memory range.
+ * @custdesc Failure in the security subsystem.
+ */
+ l_err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ RUNTIME::MOD_OPEN_UNTRUSTED_SP_AREAS,
+ RUNTIME::RC_SP_ATTN_AREA_OVERFLOW,
+ l_spAttnCombinedSize,
+ l_spAttnStartAddr,
+ true);
+ l_err->collectTrace(RUNTIME_COMP_NAME);
+ break;
+ }
+ // Make sure our intended ATTN area 1 size is not smaller than the ATTN
+ // area 1 size reported in HDAT
+ if (PHYP_ATTN_AREA_1_SIZE < l_pCpuCtrlInfo->spAttnArea1.size)
+ {
+ TRACFCOMP( g_trac_runtime,
+ ERR_MRK"openUntrustedSpCommArea(): Hostboot's proposed SP ATTN area 1 size is smaller than what is reported in HDAT. Proposed ATTN1 sz: 0x%.16llX, HDAT ATTN1 sz: 0x%.16llX",
+ PHYP_ATTN_AREA_1_SIZE,
+ l_pCpuCtrlInfo->spAttnArea1.size);
+
+ /*@
+ * @errortype
+ * @moduleid RUNTIME::MOD_OPEN_UNTRUSTED_SP_AREAS
+ * @reasoncode RUNTIME::RC_SP_ATTN_AREA1_SIZE_OVERFLOW
+ * @userdata1 SP ATTN Area 1 size proposed by hostboot
+ * @userdata2 SP ATTN Area 1 size reported in HDAT
+ * @devdesc SP ATTN Area 1 size exceeds the maximum.
+ * @custdesc Failure in the security subsystem.
+ */
+ l_err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ RUNTIME::MOD_OPEN_UNTRUSTED_SP_AREAS,
+ RUNTIME::RC_SP_ATTN_AREA1_SIZE_OVERFLOW,
+ PHYP_ATTN_AREA_1_SIZE,
+ l_pCpuCtrlInfo->spAttnArea1.size,
+ true);
+ l_err->collectTrace(RUNTIME_COMP_NAME);
+ break;
+ }
+
+ // calculate absolute address for PHYP SP ATTN areas
+ auto l_abs = SECUREBOOT::calcSpAttnAreaStart();
+
+ l_pCpuCtrlInfo->spAttnArea1.address = l_abs;
+ l_pCpuCtrlInfo->spAttnArea2.address = l_abs + PHYP_ATTN_AREA_1_SIZE;
+ }
+
// Open unsecure SBE memory regions
// Loop through all functional Procs
TARGETING::TargetHandleList l_procChips;
OpenPOWER on IntegriCloud