-
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.
SMF: Distribute Secure Memory Among Procs
Logic for distributing the requested amount of SMF memory between the procs with memory on the system. The algorithm attempts to allocate the memory in power-of-two increments of 256MB (such is the HW limitation) under each proc until the requested amount is satisfied or until we run out of procs with memory. Change-Id: Ica3e1706bdb731762a3daf07c11d889fc7b6367f RTC: 192411 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68128 Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Roland Veloz <rveloz@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> 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: Daniel M. Crowell <dcrowell@us.ibm.com>
- Loading branch information
1 parent
cbf7565
commit 50182cf
Showing
8 changed files
with
428 additions
and
1 deletion.
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
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,66 @@ | ||
/* IBM_PROLOG_BEGIN_TAG */ | ||
/* This is an automatically generated prolog. */ | ||
/* */ | ||
/* $Source: src/include/usr/secureboot/smf.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_H | ||
#define __SMF_H | ||
|
||
#include <errl/errlentry.H> | ||
#include <stdint.h> | ||
|
||
namespace SMF_TRACE | ||
{ | ||
extern trace_desc_t* g_trac_smf; | ||
} | ||
|
||
namespace SECUREBOOT | ||
{ | ||
namespace SMF | ||
{ | ||
|
||
/** | ||
* @brief A function that destributes the requested amount of secure | ||
* memory between the functional procs with memory on the system. | ||
* The memory is distributed in power-of-two chunks of 256MB | ||
* until either all memory is distributed or there are no procs | ||
* remaining with memory available. The function returns predictive | ||
* or informational errors in the following cases: there is no | ||
* available memory behind the procs on the system (predictive error), | ||
* the exact amount of secure mem allocated did not match the requested | ||
* amount (informational error). If 0 is passed in to the function, no | ||
* attempt at distribution occurs and the SMF mode is turned off. | ||
* | ||
* @param[in] i_requestedSmfMemAmtInBytes the amount of secure memory to be | ||
* distributed (in bytes) | ||
* among the procs on the system | ||
* | ||
* @return nullptr: the memory was successfully distributed as requested | ||
* non-nullptr: a distribution error occurred (this error is never | ||
* unrecoverable) | ||
*/ | ||
errlHndl_t distributeSmfMem(uint64_t i_requestedSmfMemAmtInBytes); | ||
|
||
} // 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ ROOTPATH = ../../../.. | |
MODULE = smf | ||
|
||
OBJS += smf_utils.o | ||
OBJS += smf.o | ||
|
||
include ${ROOTPATH}/config.mk | ||
|
Oops, something went wrong.