From ba9cad2c031bcf85fd34f8f3e8c477d38ed1db71 Mon Sep 17 00:00:00 2001 From: Jaymes Wilks Date: Fri, 17 Nov 2017 09:23:44 -0600 Subject: Create better anti-deadlock strategy for vfs Addresses situations in the error paths of vfs resource provider where the handler may deadlock. As a precautionary measure, the same change was applied to secure PNOR resource provider just in case a new deadlock scenario gets introduced through future code changes. Change-Id: I1bda8c28ad9a3a1758cd6b8ae2e35f67c3e0572c RTC:176134 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50068 Reviewed-by: Michael Baiocchi Reviewed-by: Nicholas E. Bofferding Tested-by: Jenkins Server Reviewed-by: Stephen M. Cprek Tested-by: FSP CI Jenkins Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Daniel M. Crowell --- src/include/usr/secureboot/service.H | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/include') diff --git a/src/include/usr/secureboot/service.H b/src/include/usr/secureboot/service.H index c4dc31334..7203ae879 100644 --- a/src/include/usr/secureboot/service.H +++ b/src/include/usr/secureboot/service.H @@ -284,9 +284,15 @@ namespace SECUREBOOT * never return from this call) or not (and return from this call). * In general, code should wait for shutdown unless early in boot before * basic services are up, or in a resource provider path. + * @param[in] i_calledByRP Indicates that this function is being called from + * within a resource provider message handler, which lets the + * implementation know that it needs to take precautionary measures to + * avoid deadlock scenarios. If called by a resource provider pass true. + * If not, false. */ - void handleSecurebootFailure( - errlHndl_t &io_err, bool i_waitForShutdown = true); + void handleSecurebootFailure(errlHndl_t &io_err, + bool i_waitForShutdown = true, + bool i_calledByRP = false); /** * @brief Adds the values of the Security Registers of the processors in @@ -297,18 +303,23 @@ namespace SECUREBOOT * NOTE: The state of the system/processors * (ie, SCOM vs FSI) determines which registers can * be included. - * + * @param[in] i_calledByRP See the handleSecurebootFailure function's + * "called by resource provider" option. * @return N/A */ - void addSecurityRegistersToErrlog(errlHndl_t & io_err); + void addSecurityRegistersToErrlog(errlHndl_t & io_err, + bool i_calledByRP = false); /** * @brief Common handler for adding all relevant secureboot information to * the user details section of an error log * @param[in/out] io_err Error Log to add secure info to. * Must not be nullptr. + * @param[in] i_calledByRP See the handleSecurebootFailure function's + * "called by resource provider" option. */ - void addSecureUserDetailsToErrolog(errlHndl_t & io_err); + void addSecureUserDetailsToErrlog(errlHndl_t & io_err, + bool i_calledByRP = false); /* * @brief Determines if Attribute Overrides are Allowed -- cgit v1.2.3