-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move HOMER BAR to Secure Memory in SMF Mode
This commits enables HOMER BAR to point to the top of the secure memory on SMF-enabled systems. Consequently, the HOMER image and hostboot reserved memory will be moved to the secure memory if SMF is enabled. Change-Id: I37c7527b06688a41e57f14b4107ff53a507ffae8 RTC: 198825 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66702 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@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: Daniel M. Crowell <dcrowell@us.ibm.com>
- Loading branch information
1 parent
de9ec8d
commit 1aae1ba
Showing
20 changed files
with
562 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/* IBM_PROLOG_BEGIN_TAG */ | ||
/* This is an automatically generated prolog. */ | ||
/* */ | ||
/* $Source: src/include/usr/isteps/mem_utils.H $ */ | ||
/* */ | ||
/* OpenPOWER HostBoot Project */ | ||
/* */ | ||
/* Contributors Listed Below - COPYRIGHT 2018 */ | ||
/* [+] International Business Machines Corp. */ | ||
/* */ | ||
/* */ | ||
/* Licensed under the Apache License, Version 2.0 (the "License"); */ | ||
/* you may not use this file except in compliance with the License. */ | ||
/* You may obtain a copy of the License at */ | ||
/* */ | ||
/* http://www.apache.org/licenses/LICENSE-2.0 */ | ||
/* */ | ||
/* Unless required by applicable law or agreed to in writing, software */ | ||
/* distributed under the License is distributed on an "AS IS" BASIS, */ | ||
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ | ||
/* implied. See the License for the specific language governing */ | ||
/* permissions and limitations under the License. */ | ||
/* */ | ||
/* IBM_PROLOG_END_TAG */ | ||
#ifndef __MEM_UTILS_H | ||
#define __MEM_UTILS_H | ||
|
||
#include <errl/errlentry.H> | ||
|
||
namespace ISTEP | ||
{ | ||
|
||
/** | ||
* @brief Utility function to obtain the highest known address in the system | ||
* | ||
* @return The highest address in the system in bytes | ||
*/ | ||
uint64_t get_top_mem_addr(); | ||
|
||
/** | ||
* @brief Utility function to obtain the highest known address in a given proc | ||
* | ||
* @param[in] i_proc: Proc that we want to calculate the top address for; | ||
* must not be nullptr or the func will assert | ||
* must be of TYPE_PROC or the func will assert | ||
* | ||
* @return The highest address in the given proc (in bytes) | ||
*/ | ||
uint64_t get_top_mem_addr(const TARGETING::Target* i_proc); | ||
|
||
/** | ||
* @brief Utility function to obtain the lowest known address in the system | ||
* | ||
* @return the lowest know address in the system | ||
*/ | ||
uint64_t get_bottom_mem_addr(); | ||
|
||
/** | ||
* @brief Utility function to obtain the lowest known address in a given proc | ||
* | ||
* @param[in] i_proc: Proc that we want to calculate the bottom address for; | ||
* must not be nullptr or the func will assert | ||
* must be of TYPE_PROC or the func will assert | ||
* | ||
* @return the lowest know address on the specified proc | ||
*/ | ||
uint64_t get_bottom_mem_addr(const TARGETING::Target* i_proc); | ||
|
||
/** | ||
* @brief Utility function to obtain the highest known SMF base address on | ||
* the system. | ||
* | ||
* @return: the address (in bytes) of the top SMF memory | ||
* | ||
*/ | ||
uint64_t get_top_smf_mem_addr(); | ||
|
||
/** | ||
* @brief Utility function to obtain the SMF base address on the given proc | ||
* | ||
* @param[in] i_proc: Proc to fetch the SMF BAR from; | ||
* must not be nullptr or the func will assert | ||
* must be of TYPE_PROC or the func will assert | ||
* | ||
* | ||
* @return The SMF BAR of the given proc (in bytes) | ||
*/ | ||
uint64_t get_top_smf_mem_addr(const TARGETING::Target* i_proc); | ||
|
||
/** | ||
* @brief Utility function to fetch the top of the HOMER memory | ||
* | ||
* @return the address of the HOMER mem | ||
* | ||
* @note When SMF is enabled, the highest available SMF BAR will be returned; | ||
* when SMF is disabled, the function behaves exactly like | ||
* get_top_mem_addr | ||
*/ | ||
uint64_t get_top_homer_mem_addr(); | ||
|
||
} //namespace ISTEP | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* IBM_PROLOG_BEGIN_TAG */ | ||
/* This is an automatically generated prolog. */ | ||
/* */ | ||
/* $Source: src/include/usr/secureboot/smf_utils.H $ */ | ||
/* */ | ||
/* OpenPOWER HostBoot Project */ | ||
/* */ | ||
/* Contributors Listed Below - COPYRIGHT 2018 */ | ||
/* [+] International Business Machines Corp. */ | ||
/* */ | ||
/* */ | ||
/* Licensed under the Apache License, Version 2.0 (the "License"); */ | ||
/* you may not use this file except in compliance with the License. */ | ||
/* You may obtain a copy of the License at */ | ||
/* */ | ||
/* http://www.apache.org/licenses/LICENSE-2.0 */ | ||
/* */ | ||
/* Unless required by applicable law or agreed to in writing, software */ | ||
/* distributed under the License is distributed on an "AS IS" BASIS, */ | ||
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ | ||
/* implied. See the License for the specific language governing */ | ||
/* permissions and limitations under the License. */ | ||
/* */ | ||
/* IBM_PROLOG_END_TAG */ | ||
#ifndef __SMF_UTILS_H | ||
#define __SMF_UTILS_H | ||
|
||
#include <stdint.h> | ||
#include <errl/errlentry.H> | ||
|
||
namespace SECUREBOOT | ||
{ | ||
|
||
namespace SMF | ||
{ | ||
|
||
// HW limitations dictate that SMF memory needs to be a power-of-two | ||
// multiple of 256MB starting with 256MB. | ||
extern const uint64_t MIN_SMF_MEMORY_AMT; | ||
|
||
/** | ||
* @brief Checks whether SMF mode is enabled on the system | ||
* | ||
* @return true: SMF is enabled; false: SMF is disabled. | ||
*/ | ||
bool isSmfEnabled(); | ||
|
||
/** | ||
* @brief Checks whether the system has the correct risk level to | ||
* support SMF: SMF is supported on Axone by default or on | ||
* NIMBUS or CUMULUS with risk level >= 4. | ||
* | ||
* @return nullptr: the current system supports SMF | ||
* non-nullptr: an internal error occurred or the system | ||
* does not support SMF | ||
*/ | ||
errlHndl_t checkRiskLevelForSmf(); | ||
|
||
} // namespace SMF | ||
|
||
} // namespace SECUREBOOT | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,8 @@ | |
//HRMOR | ||
#include <sys/misc.h> | ||
|
||
#include <isteps/mem_utils.H> | ||
|
||
namespace ISTEP_07 | ||
{ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.