From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c00::235; helo=mail-pf0-x235.google.com; envelope-from=heyi.guo@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2E8FC222A334B for ; Sat, 24 Feb 2018 00:22:42 -0800 (PST) Received: by mail-pf0-x235.google.com with SMTP id 17so4486716pfw.11 for ; Sat, 24 Feb 2018 00:28:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=z2oTASvQxbDLAIp+jJuXGSdKotQp/bbMnftF3OdSK8k=; b=hnmTjB0XzncGh6I7j0lELcrb42T5Rt+fYoTLynpfDs3Jd/a+MtjOw3H+XCyE8Bb520 5LVmxj77UxkSO99y27dMmSDnNO643JX5og5V+y8pESJDo57ZVbDi6m2FjrbC/aAwDtAJ emFmNv4AYghLoGdgcINJrumXiAj+01X0pU7k0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=z2oTASvQxbDLAIp+jJuXGSdKotQp/bbMnftF3OdSK8k=; b=tjKf1bDQZWEg23DFr+KvamanQ6mihM/koaxJT2G2B4c2PLi4hfZPvcz9H5Y3s01dqL vQZj6Nic4bBC83/aAe6HlSFuGAq97jzvIl38WPVjenYGep2wVOxBbBYlov06+DlHpKCz L9XfOSyFGz7IY5xbon9hmve/dXRA8IDWwVzBeKpr1KZecQAVtknJRvUGkDzYPbyCinBx yrzZFuR2pb7JW9N7dUAy1oTVOZJpBVjYH3OPRabBIcumCO2mvRfYWlT/wd9XlXzHlQt0 0ZZrsWY5Mqqmq4dXMMOUAJKWAiUdCoW1rwrVf7RfFF3aubE9LPAxn1FrfBJIBCufrJDq wFdA== X-Gm-Message-State: APf1xPDs2GrMW19tvdecCzARFNaItYepaAvIvIu3Fik26IQJMvPiB3jv iHXMY0ZPIq43QtJCHkdBdhldZw== X-Google-Smtp-Source: AH8x226vCzwYZPFFTpq4Ac9LqXL4nzVKZfI+Lc/Ry5i/PZYSA+prbfYCuhNM1EHK8oLjyzF/3eC1yg== X-Received: by 10.99.108.66 with SMTP id h63mr3402650pgc.177.1519460925045; Sat, 24 Feb 2018 00:28:45 -0800 (PST) Received: from SZX1000114654 ([104.237.91.49]) by smtp.gmail.com with ESMTPSA id z6sm6670837pgu.49.2018.02.24.00.28.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Feb 2018 00:28:44 -0800 (PST) From: Guo Heyi X-Google-Original-From: Guo Heyi Date: Sat, 24 Feb 2018 16:28:41 +0800 To: "Ni, Ruiyu" Cc: Guo Heyi , edk2-devel@lists.01.org, Star Zeng , Eric Dong Message-ID: <20180224082841.GB111715@SZX1000114654> References: <20180224062316.GA111715@SZX1000114654> <51de13de-ff0f-2bc8-dfb8-a6ea0685f3c6@Intel.com> MIME-Version: 1.0 In-Reply-To: <51de13de-ff0f-2bc8-dfb8-a6ea0685f3c6@Intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) 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:22:43 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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? That's fine for me :) Thanks, Gary (Heyi Guo) > > > > >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