summaryrefslogtreecommitdiffstats
path: root/src/usr/hwas
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2017-04-27 09:32:02 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-05-25 09:45:36 -0400
commite0a1b4a4f6d9bd7927fddcc508d24f9218dfbb13 (patch)
tree2a88a7b68a8ed3b3dc7f3a54a8bf3bec9b411b45 /src/usr/hwas
parentc578a6cdfbbc2b77c988548b81df6e1d9f202582 (diff)
downloadtalos-hostboot-e0a1b4a4f6d9bd7927fddcc508d24f9218dfbb13.tar.gz
talos-hostboot-e0a1b4a4f6d9bd7927fddcc508d24f9218dfbb13.zip
Add support for remembering deconfigs without GUARD
Currently on reconfig reboots only parts that are GUARDed are remembered and reapplied. - Add suport for a semi persisent PNOR partition, HB_VOLATILE which Hostboot uses to keep track of the reconfig reboots vs power off - Add a new GUARD type specifically for reconfig loops - Add RECALL_DECONFIG_ON_RECONFIG config flag to control what gets added to GUARD partition - During boot will add/clear guard records on deconfig based on config flags and semi persisent state. Change-Id: Iec636058cde8095c0c4216d1f95ae4fda554395e Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/39780 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/hwas')
-rw-r--r--src/usr/hwas/HBconfig6
-rw-r--r--src/usr/hwas/common/deconfigGard.C59
-rw-r--r--src/usr/hwas/hwasPlatCallout.C22
-rw-r--r--src/usr/hwas/hwasPlatDeconfigGard.C8
4 files changed, 87 insertions, 8 deletions
diff --git a/src/usr/hwas/HBconfig b/src/usr/hwas/HBconfig
index 8f6791be4..f219e3ec6 100644
--- a/src/usr/hwas/HBconfig
+++ b/src/usr/hwas/HBconfig
@@ -3,6 +3,12 @@ config NO_GARD_SUPPORT
help
Skip guarding when set
+config RECALL_DECONFIG_ON_RECONFIG
+ default n
+ help
+ Remember both garded and deconfigured parts on a reconfig loop.
+ Normally only garded parts are remembered.
+
config HOST_HCDB_SUPPORT
default n
depends on MEMVPD_READ_FROM_HW || MVPD_READ_FROM_HW || DJVPD_READ_FROM_HW
diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C
index 6f1925b9c..82ee77aff 100644
--- a/src/usr/hwas/common/deconfigGard.C
+++ b/src/usr/hwas/common/deconfigGard.C
@@ -105,6 +105,12 @@ errlHndl_t collectGard(const PredicateBase *i_pPredicate)
}
return errl;
} // collectGard
+
+errlHndl_t clearGardByType(const GARD_ErrorType i_type)
+{
+ return theDeconfigGard().clearGardRecordsByType(i_type);
+}
+
#endif
//******************************************************************************
@@ -190,7 +196,7 @@ errlHndl_t DeconfigGard::applyGardRecord(Target *i_pTarget,
//******************************************************************************
errlHndl_t DeconfigGard::clearGardRecordsForReplacedTargets()
{
- HWAS_INF("User Request: Clear GARD Records for replaced Targets");
+ HWAS_INF("Clear GARD Records for replaced Targets");
errlHndl_t l_pErr = NULL;
// Create the predicate with HWAS changed state and our GARD bit
@@ -355,6 +361,57 @@ errlHndl_t DeconfigGard::clearGardRecordsForReplacedTargets()
} // clearGardRecordsForReplacedTargets
//******************************************************************************
+errlHndl_t DeconfigGard::clearGardRecordsByType(const GARD_ErrorType i_type)
+{
+ HWAS_INF("Clear GARD Records by type %x", i_type);
+ errlHndl_t l_pErr = nullptr;
+
+ do
+ {
+ GardRecords_t l_gardRecords;
+ l_pErr = platGetGardRecords(nullptr, l_gardRecords);
+ if (l_pErr)
+ {
+ HWAS_ERR("Error from platGetGardRecords");
+ break;
+ }
+
+ // For each GARD Record
+ for (const auto & l_gardRecord : l_gardRecords)
+ {
+ //If this is the type to clear
+ if(l_gardRecord.iv_errorType == i_type)
+ {
+ // Find the associated Target
+ Target* l_pTarget = targetService().
+ toTarget(l_gardRecord.iv_targetId);
+
+ if (l_pTarget == nullptr)
+ {
+ // could be a platform specific target for the other
+ // ie, we are hostboot and this is an FSP target, or
+ // vice-versa
+ // we just skip this GARD record
+ continue;
+ }
+
+ l_pErr = platClearGardRecords(l_pTarget);
+ if (l_pErr)
+ {
+ HWAS_ERR("Error from platClearGardRecords");
+ break;
+ }
+
+ }
+ }
+ }
+ while (0);
+
+ return l_pErr;
+} // clearGardRecordsByType
+
+
+//******************************************************************************
errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl(
const PredicateBase *i_pPredicate)
{
diff --git a/src/usr/hwas/hwasPlatCallout.C b/src/usr/hwas/hwasPlatCallout.C
index 2385434cc..5c6f8e687 100644
--- a/src/usr/hwas/hwasPlatCallout.C
+++ b/src/usr/hwas/hwasPlatCallout.C
@@ -97,9 +97,18 @@ errlHndl_t platHandleHWCallout(
}
default:
{
+
+#ifndef CONFIG_NO_GARD_SUPPORT
errl = HWAS::theDeconfigGard().platCreateGardRecord(i_pTarget,
io_errl->eid(),
i_gardErrorType);
+#elif CONFIG_RECALL_DECONFIG_ON_RECONFIG
+ //If Gard is turned off, always populate a reconfig type
+ //in case of a reconfig loop
+ errl = HWAS::theDeconfigGard()
+ .platCreateGardRecord(i_pTarget,io_errl->eid(),
+ GARD_Reconfig);
+#endif
break;
}
} // switch i_gardErrorType
@@ -115,6 +124,19 @@ errlHndl_t platHandleHWCallout(
// call HWAS common function
errl = HWAS::theDeconfigGard().deconfigureTarget(*i_pTarget,
io_errl->eid());
+
+#ifdef CONFIG_RECALL_DECONFIG_ON_RECONFIG
+ //Always force a gard record on deconfig. If already
+ //garded, won't update/harm anything
+ if(!errl)
+ {
+ errl = HWAS::theDeconfigGard()
+ .platCreateGardRecord(i_pTarget,
+ io_errl->eid(),
+ GARD_Reconfig);
+ }
+#endif
+
break;
}
case (DELAYED_DECONFIG):
diff --git a/src/usr/hwas/hwasPlatDeconfigGard.C b/src/usr/hwas/hwasPlatDeconfigGard.C
index b98fa28d8..6c8aa27d5 100644
--- a/src/usr/hwas/hwasPlatDeconfigGard.C
+++ b/src/usr/hwas/hwasPlatDeconfigGard.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2016 */
+/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -91,7 +91,6 @@ errlHndl_t DeconfigGard::platClearGardRecords(
{
errlHndl_t l_pErr = NULL;
-#ifndef CONFIG_NO_GARD_SUPPORT
EntityPath l_targetId;
if (!i_pTarget)
{
@@ -144,7 +143,6 @@ errlHndl_t DeconfigGard::platClearGardRecords(
}
HWAS_MUTEX_UNLOCK(iv_mutex);
-#endif // CONFIG_NO_GARD_SUPPORT
return l_pErr;
}
@@ -155,7 +153,6 @@ errlHndl_t DeconfigGard::platGetGardRecords(
errlHndl_t l_pErr = NULL;
o_records.clear();
-#ifndef CONFIG_NO_GARD_SUPPORT
EntityPath l_targetId;
if (!i_pTarget)
{
@@ -201,7 +198,6 @@ errlHndl_t DeconfigGard::platGetGardRecords(
HWAS_MUTEX_UNLOCK(iv_mutex);
HWAS_INF("Get returning %d GARD Records", o_records.size());
-#endif // CONFIG_NO_GARD_SUPPORT
return l_pErr;
}
@@ -215,7 +211,6 @@ errlHndl_t DeconfigGard::platCreateGardRecord(
get_huid(i_pTarget), i_errlEid);
errlHndl_t l_pErr = NULL;
-#ifndef CONFIG_NO_GARD_SUPPORT
HWAS_MUTEX_LOCK(iv_mutex);
do
@@ -396,7 +391,6 @@ errlHndl_t DeconfigGard::platCreateGardRecord(
while (0);
HWAS_MUTEX_UNLOCK(iv_mutex);
-#endif // CONFIG_NO_GARD_SUPPORT
return l_pErr;
}
OpenPOWER on IntegriCloud