From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 3FCD92034D8FE for ; Sat, 24 Feb 2018 00:34:20 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2018 00:40:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,386,1515484800"; d="scan'208";a="19901129" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga007.fm.intel.com with ESMTP; 24 Feb 2018 00:40:22 -0800 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 24 Feb 2018 00:40:22 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 24 Feb 2018 00:40:22 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.125]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0319.002; Sat, 24 Feb 2018 16:40:20 +0800 From: "Ni, Ruiyu" To: Guo Heyi CC: "edk2-devel@lists.01.org" , "Zeng, Star" , "Dong, Eric" Thread-Topic: MdeModulePkg/UefiBootManagerLib: recursive call of BmRepairAllControllers Thread-Index: AQHTrTf4fIecCZDaxUKCU2HTh98OqqOzNlQA//98E4CAAIlGsA== Date: Sat, 24 Feb 2018 08:40:20 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BBC02C2@SHSMSX104.ccr.corp.intel.com> References: <20180224062316.GA111715@SZX1000114654> <51de13de-ff0f-2bc8-dfb8-a6ea0685f3c6@Intel.com> <20180224082841.GB111715@SZX1000114654> In-Reply-To: <20180224082841.GB111715@SZX1000114654> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 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:34:21 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Will you submit a patch for this change? Thanks/Ray > -----Original Message----- > From: Guo Heyi [mailto:heyi.guo@linaro.org] > Sent: Saturday, February 24, 2018 4:29 PM > To: Ni, Ruiyu > Cc: Guo Heyi ; edk2-devel@lists.01.org; Zeng, Star > ; Dong, Eric > Subject: Re: MdeModulePkg/UefiBootManagerLib: recursive call of > BmRepairAllControllers >=20 > On Sat, Feb 24, 2018 at 04:20:52PM +0800, Ni, Ruiyu wrote: > > 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? >=20 > That's fine for me :) >=20 > Thanks, >=20 > Gary (Heyi Guo) >=20 > > > > > > > >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