Skip to content

Commit

Permalink
Revert "Terminate the IPL for Physical Presence Detection Erros in Mn…
Browse files Browse the repository at this point in the history
…fg Mode"

This reverts commit 74d6847.

CQ: SW488759
Change-Id: I62187d75dd18f1d107cad5168aa0d4894770600d
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/94604
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
Tested-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mabaiocchi authored and dcrowell77 committed Apr 8, 2020
1 parent 9f4f5c8 commit ed42128
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 56 deletions.
2 changes: 1 addition & 1 deletion src/include/usr/ipmi/ipmisensor.H
Expand Up @@ -1069,7 +1069,7 @@ namespace SENSOR
* maintained by the BMC.
*
* Usage:
* uint8_t key_clear_request_value = 0x01; //MSByte of Key Clear value
* uint8_t key_clear_request_value = 0x0100;
* KeyClearRequestSensor l_sensor;
* l_sensor.setKeyClearRequestValue( key_clear_request_value );
*
Expand Down
4 changes: 2 additions & 2 deletions src/usr/ipmiext/ipmisensor.C
Expand Up @@ -1035,7 +1035,7 @@ namespace SENSOR
//
errlHndl_t KeyClearRequestSensor::setKeyClearRequest(const uint8_t i_value)
{
// This is a threshold sensor that sets one byte of data in the
// This is a threshhhold sensor that sets one byte of data in the
// iv_sensor_reading field
iv_msg->iv_sensor_reading = i_value;

Expand All @@ -1047,7 +1047,7 @@ namespace SENSOR
//
errlHndl_t KeyClearRequestSensor::getKeyClearRequest( uint8_t &o_value )
{
// This is a threshold sensor that returns one byte of data in
// This is a threshhhold sensor that returns one byte of data in
// the sensor_status field
getSensorReadingData l_data;

Expand Down
61 changes: 8 additions & 53 deletions src/usr/secureboot/ext/phys_presence.C
Expand Up @@ -54,37 +54,6 @@ using namespace ERRORLOG;
namespace SECUREBOOT
{

/**
* @brief Local function returning if IPL is in Mnfg Mode
*
* @return Returns true if in manufactoring mode (based on MNFG_FLAG_SRC_TERM
* being enabled in ATTR_MNFG_FLAGS); otherwise, returns false
*/
bool isMnfgIpl(void)
{
bool retVal = false;

// Find out if in manufacturing mode
TARGETING::Target* pTopLevel = nullptr;
TARGETING::targetService().getTopLevelTarget(pTopLevel);
assert(pTopLevel != nullptr,"Top level target was nullptr");

auto mnfgFlags = pTopLevel->getAttr<TARGETING::ATTR_MNFG_FLAGS>();

if (mnfgFlags & TARGETING::MNFG_FLAG_SRC_TERM)
{
retVal = true;
}

return retVal;
}

/**
* @brief Checks if the Physical Presence Window was opened and if
* Physical Presence was asserted.
*
* See src/include/usr/secureboot/phys_presence_if.H for details
*/
errlHndl_t detectPhysPresence(void)
{
errlHndl_t err = nullptr;
Expand Down Expand Up @@ -378,14 +347,11 @@ errlHndl_t detectPhysPresence(void)
sys->setAttr<ATTR_PHYS_PRES_ASSERTED>(is_phys_pres_asserted);
}

// If there is an error...
// 1) but there was not a key clear request requiring the assertion of
// physical presence --AND--
// 2) it wasn't a mnfg mode IPL, then
// make the error informational and commit it here so as not to halt the IPL
// If there is an error, but there was not a key clear request requiring
// the assertion of physical presence, make the error informational and
// commit it here so as not to halt the IPL
if ((err != nullptr) &&
(doesKeyClearRequestPhysPres == false) &&
(isMnfgIpl() == false))
(doesKeyClearRequestPhysPres == false))
{
err->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL);
SB_ERR("detectPhysPresence: Setting ERR to informational and "
Expand All @@ -404,14 +370,6 @@ errlHndl_t detectPhysPresence(void)
return err;
}

/**
* @brief Handle Physical Presence Window first checks to see if a physical
* presence window should be opened. Then, if necessary, it sets up
* the physical presence detect circuit and then shuts down the
* system.
*
* See src/include/usr/secureboot/phys_presence_if.H for details
*/
errlHndl_t handlePhysPresenceWindow(void)
{
errlHndl_t err = nullptr;
Expand Down Expand Up @@ -688,14 +646,11 @@ errlHndl_t handlePhysPresenceWindow(void)

} while (0);

// If there is an error...
// 1) but there was not a key clear request requiring the assertion of
// physical presence --AND--
// 2) it wasn't a mnfg mode IPL, then
// make the error informational and commit it here so as not to halt the IPL
// If there is an error, but there was not a key clear request requiring
// the assertion of physical presence, make the error informational and
// commit it here so as not to halt the IPL
if ((err != nullptr) &&
(doesKeyClearRequestPhysPres == false) &&
(isMnfgIpl() == false))
(doesKeyClearRequestPhysPres == false))
{
err->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL);
SB_ERR("handlePhysPresenceWindow: Setting ERR to informational and "
Expand Down

0 comments on commit ed42128

Please sign in to comment.