From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4884E2034D8FB for ; Sat, 24 Feb 2018 00:15:09 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2018 00:20:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,386,1515484800"; d="scan'208";a="33258264" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.13]) ([10.239.9.13]) by fmsmga001.fm.intel.com with ESMTP; 24 Feb 2018 00:20:52 -0800 To: Guo Heyi , edk2-devel@lists.01.org Cc: Star Zeng , Eric Dong References: <20180224062316.GA111715@SZX1000114654> From: "Ni, Ruiyu" Message-ID: <51de13de-ff0f-2bc8-dfb8-a6ea0685f3c6@Intel.com> Date: Sat, 24 Feb 2018 16:20:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180224062316.GA111715@SZX1000114654> Subject: Re: MdeModulePkg/UefiBootManagerLib: recursive call of BmRepairAllControllers X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Feb 2018 08:15:21 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 2/24/2018 2:23 PM, Guo Heyi wrote: > Hi folks, > > In BmDriverHealth.c, function BmRepairAllControllers may recursively call itself > if some driver health protocol returns EfiDriverHealthStatusReconnectRequired. > However, if there is something wrong in some 3rd party driver (e.g. PCI oprom), > the driver health protocol of that driver may always return such status even > after one and another reconnect. The endless iteration will cause stack overflow > and then system exception, and it may be not easy to find that the exception is > actually caused by stack overflow. yes. I agree. If a buggy PCI oprom always return ReconnectRequired, the stack overflow will happen. How about we choose maximum recursive call depth as 10 and continue to boot if call depth reaches 11? > > So does it make sense to set a maximum count of this recursive call to avoid > whole system hang even there is a buggy 3rd party driver? > > Thanks, > > Gary (Heyi Guo) > -- Thanks, Ray