diff options
| author | Jaymes Wilks <mjwilks@us.ibm.com> | 2018-06-21 11:50:46 -0500 |
|---|---|---|
| committer | William G. Hoffa <wghoffa@us.ibm.com> | 2018-06-26 11:52:33 -0400 |
| commit | d406ad362d7f95cef1425216996f08fb5a1c7dca (patch) | |
| tree | 1d44a17aa093f0e2ec7d59bf40064f93fe5c85df /src | |
| parent | 0e138b0da002197cc86f601be5b307386a5fdfab (diff) | |
| download | talos-hostboot-d406ad362d7f95cef1425216996f08fb5a1c7dca.tar.gz talos-hostboot-d406ad362d7f95cef1425216996f08fb5a1c7dca.zip | |
SP ATTN area relative addressing cleanup
This change attemps to remove some technical debt incurred by the
"HRMOR relative addressing for PHyp SP ATTN area dump" commit.
Change-Id: I773c25e6f704fba561aa78106120325562698e4e
RTC:186439
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61099
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@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: ILYA SMIRNOV <ismirno@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/include/usr/runtime/runtime.H | 19 | ||||
| -rw-r--r-- | src/include/usr/secureboot/service.H | 17 | ||||
| -rw-r--r-- | src/usr/isteps/istep16/call_host_ipl_complete.C | 2 | ||||
| -rw-r--r-- | src/usr/runtime/populate_hbruntime.C | 4 |
4 files changed, 22 insertions, 20 deletions
diff --git a/src/include/usr/runtime/runtime.H b/src/include/usr/runtime/runtime.H index 3ac97e81a..b5e717e2b 100644 --- a/src/include/usr/runtime/runtime.H +++ b/src/include/usr/runtime/runtime.H @@ -32,6 +32,9 @@ #include <hdat/hdat.H> #include "../../../src/usr/runtime/hdatstructs.H" #include <vmmconst.h> +#include <sys/misc.h> +#include <kernel/vmmmgr.H> + namespace RUNTIME { @@ -371,6 +374,22 @@ void findHdatLocation(uint64_t payloadBase_va, */ errlHndl_t getRsvdMemTraceBuf(uint64_t& o_RsvdMemAddress, uint64_t& o_size); + +/* + * @brief Calculates the node's proposed start address for the system's + * SP ATTN areas, which becomes the effective configuration if it's + * elected as the master. + * + * @return uint64_t Absolute start address for the intended SP ATTN areas + */ +inline uint64_t calcSpAttnAreaStart() +{ + auto hrmorVal = cpu_spr_value(CPU_SPR_HRMOR); + return (hrmorVal - VMM_HRMOR_OFFSET + PHYP_ATTN_AREA_OFFSET) + | VmmManager::FORCE_PHYS_ADDR; +} + + } #endif diff --git a/src/include/usr/secureboot/service.H b/src/include/usr/secureboot/service.H index 33d2771bf..bb6ea1516 100644 --- a/src/include/usr/secureboot/service.H +++ b/src/include/usr/secureboot/service.H @@ -32,9 +32,6 @@ #include <cstdint> #include <securerom/sha512.H> #include <securerom/ROM.H> -#include <vmmconst.h> -#include <sys/misc.h> -#include <kernel/vmmmgr.H> /* * @brief Used to capture the first 4 bytes of the hash for tracing purposes @@ -372,20 +369,6 @@ namespace SECUREBOOT */ errlHndl_t setSbeSecurityMode(uint8_t i_sbeSecurityMode); - /* - * @brief Calculates the node's proposed start address for the system's - * SP ATTN areas, which becomes the effective configuration if it's - * elected as the master. - * - * @return uint64_t Absolute start address for the intended SP ATTN areas - */ - inline uint64_t calcSpAttnAreaStart() - { - auto hrmorVal = cpu_spr_value(CPU_SPR_HRMOR); - return (hrmorVal - VMM_HRMOR_OFFSET + PHYP_ATTN_AREA_OFFSET) - | VmmManager::FORCE_PHYS_ADDR; - } - } #endif diff --git a/src/usr/isteps/istep16/call_host_ipl_complete.C b/src/usr/isteps/istep16/call_host_ipl_complete.C index 1d2f711a7..df2e6305c 100644 --- a/src/usr/isteps/istep16/call_host_ipl_complete.C +++ b/src/usr/isteps/istep16/call_host_ipl_complete.C @@ -290,7 +290,7 @@ void* call_host_ipl_complete (void *io_pArgs) if ( INITSERVICE::spBaseServicesEnabled() && is_phyp_load()) { // calculate absolute address for PHYP SP ATTN areas - auto l_abs = SECUREBOOT::calcSpAttnAreaStart(); + auto l_abs = RUNTIME::calcSpAttnAreaStart(); auto spAttnArea1Addr = l_abs; auto spAttnArea2Addr = l_abs + PHYP_ATTN_AREA_1_SIZE; diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C index db2fa42c7..42f3fc50b 100644 --- a/src/usr/runtime/populate_hbruntime.C +++ b/src/usr/runtime/populate_hbruntime.C @@ -3403,7 +3403,7 @@ errlHndl_t openUntrustedSpCommArea(const uint64_t i_commBase) l_spAttnStartAddr, l_spAttnCombinedSize); - // If in phyp mode and the master + // If in phyp mode and the master then update SP ATTN area values in HDAT if (TARGETING::is_phyp_load() && TARGETING::UTIL::isCurrentMasterNode()) { // make sure ATTN area never grows beyond the SP/PHyp untrusted region @@ -3465,7 +3465,7 @@ errlHndl_t openUntrustedSpCommArea(const uint64_t i_commBase) } // calculate absolute address for PHYP SP ATTN areas - auto l_abs = SECUREBOOT::calcSpAttnAreaStart(); + auto l_abs = RUNTIME::calcSpAttnAreaStart(); l_pCpuCtrlInfo->spAttnArea1.address = l_abs; l_pCpuCtrlInfo->spAttnArea2.address = l_abs + PHYP_ATTN_AREA_1_SIZE; |

