From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=15.233.44.27; helo=g2t2354.austin.hpe.com; envelope-from=sunnywang@hpe.com; receiver=edk2-devel@lists.01.org Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) (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 32A15211F8866 for ; Thu, 28 Jun 2018 23:43:35 -0700 (PDT) Received: from G4W9122.americas.hpqcorp.net (g4w9122.houston.hp.com [16.210.21.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2354.austin.hpe.com (Postfix) with ESMTPS id 50673A8; Fri, 29 Jun 2018 06:43:34 +0000 (UTC) Received: from G9W8455.americas.hpqcorp.net (2002:10d8:a15e::10d8:a15e) by G4W9122.americas.hpqcorp.net (2002:10d2:1511::10d2:1511) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 29 Jun 2018 06:43:33 +0000 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (15.241.52.10) by G9W8455.americas.hpqcorp.net (16.216.161.94) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Fri, 29 Jun 2018 06:43:34 +0000 Received: from CS1PR8401MB0933.NAMPRD84.PROD.OUTLOOK.COM (10.169.24.135) by CS1PR8401MB0360.NAMPRD84.PROD.OUTLOOK.COM (10.169.12.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.20; Fri, 29 Jun 2018 06:43:32 +0000 Received: from CS1PR8401MB0933.NAMPRD84.PROD.OUTLOOK.COM ([fe80::c567:d0e5:c732:9a66]) by CS1PR8401MB0933.NAMPRD84.PROD.OUTLOOK.COM ([fe80::c567:d0e5:c732:9a66%12]) with mapi id 15.20.0906.023; Fri, 29 Jun 2018 06:43:31 +0000 From: "Wang, Sunny (HPS SW)" To: Ruiyu Ni , "edk2-devel@lists.01.org" CC: Sean Brogan , Michael Turner , Laszlo Ersek , "Wang, Sunny (HPS SW)" Thread-Topic: [PATCH v2 2/2] MdeModulePkg/BdsDxe: Call *UnableToBoot() for ultimate boot failure Thread-Index: AQHUD27vdeUGbiGcpkmTXGHGTfiBg6R2yWGQ Date: Fri, 29 Jun 2018 06:43:31 +0000 Message-ID: References: <20180629060344.105716-1-ruiyu.ni@intel.com> <20180629060344.105716-3-ruiyu.ni@intel.com> In-Reply-To: <20180629060344.105716-3-ruiyu.ni@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sunnywang@hpe.com; x-originating-ip: [220.129.201.23] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CS1PR8401MB0360; 7:Vo/PfovktwO+hkD0I5aEubyf6ndh7/wYO+DPBpD4QmMxzTOC5fIOAQDD5Cyznakh/wFTBeocJxe/HrhjGzvxa50HV67CSUt7cZGwVrG83hqBIg0ZGHq17wEWUxlpfsqfzB8dy1n2RyORrEv9rsViFF4wVAxHCDDE3uquO9ZMGjiiak6XDeynvQkKmKDX/hc2kBY7yNf+RRMXsG+pKAYdV91NxRww+U4xhA6CB/MOI5M5RFHIhUIJqb2t9KhIcitY x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10019020)(979002)(6029001)(346002)(376002)(136003)(396003)(366004)(39860400002)(13464003)(199004)(189003)(5250100002)(476003)(2900100001)(2501003)(229853002)(14444005)(256004)(76176011)(6436002)(7696005)(53546011)(186003)(6506007)(99286004)(68736007)(446003)(11346002)(102836004)(26005)(105586002)(54906003)(106356001)(66066001)(86362001)(9686003)(486006)(316002)(25786009)(7736002)(8936002)(81166006)(110136005)(97736004)(4326008)(81156014)(6246003)(8676002)(2906002)(5660300001)(33656002)(55016002)(6306002)(53936002)(305945005)(14454004)(74316002)(6116002)(966005)(3846002)(478600001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:CS1PR8401MB0360; H:CS1PR8401MB0933.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-office365-filtering-correlation-id: 0b96d88b-e3e0-4598-a728-08d5dd8ba11e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:(222181515654134); BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:CS1PR8401MB0360; x-ms-traffictypediagnostic: CS1PR8401MB0360: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(227479698468861)(89211679590171)(162533806227266)(222181515654134)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:CS1PR8401MB0360; BCL:0; PCL:0; RULEID:; SRVR:CS1PR8401MB0360; x-forefront-prvs: 0718908305 received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: aPF/b3G+FElmY6c3JT6uopvjkRQnamPqNXRgCSULS33UmOQj4W93EdpaTfDqu3DkidBUQmc9m8vDAU7jARoIlVkyJAQOViXK/l4XbjdpRNIhPWpy1uMIvZFw9Td0NMYVMD0p8oUnLONnDP/FTlO98wojR12qEK/zeY1rOWT1FwDoGEDUEi03H+jkTS4CkBArgkTTikUkj58vZXuaf3IxrJHXSWI0WBpTzlIBIIuZreqOyQnSzru6NKD/6t5/448iCfQK7Z+uBa0TKYDgpulRxF4i0lZAqtgKUati8C8nFtZq2YevBJeXdBsMW2xrzKpjvScRMajXBZ7ok10QrMmYKhh8Vruk4wXxHnvk3SblZl4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 0b96d88b-e3e0-4598-a728-08d5dd8ba11e X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jun 2018 06:43:31.5726 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0360 X-OriginatorOrg: hpe.com Subject: Re: [PATCH v2 2/2] MdeModulePkg/BdsDxe: Call *UnableToBoot() for ultimate boot failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2018 06:43:35 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Looks good to me. Thanks for addressing my comment, Ray.=20 Reviewed-by: Sunny Wang -----Original Message----- From: Ruiyu Ni [mailto:ruiyu.ni@intel.com]=20 Sent: Friday, June 29, 2018 2:04 PM To: edk2-devel@lists.01.org Cc: Sean Brogan ; Michael Turner ; Laszlo Ersek ; Wang, Sunny (HPS SW) Subject: [PATCH v2 2/2] MdeModulePkg/BdsDxe: Call *UnableToBoot() for ultim= ate boot failure REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D982 The patch changes the default core behavior of ultimate boot failure to lau= nch Boot Manager Menu. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Sean Brogan Cc: Michael Turner Cc: Laszlo Ersek Cc: Sunny Wang --- MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 65 +++++++---------------------= ---- 1 file changed, 13 insertions(+), 52 deletions(-) diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Univer= sal/BdsDxe/BdsEntry.c index 49e403e181..db2a4cf208 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c @@ -634,55 +634,6 @@ BdsFormalizeEfiGlobalVariable ( BdsFormalizeOSIndicationVariable (); } =20 -/** - Enter an infinite loop of calling the Boot Manager Menu. - - This is a last resort alternative to BdsEntry() giving up for good. This - function never returns. - - @param[in] BootManagerMenu The EFI_BOOT_MANAGER_LOAD_OPTION located and= /or - created by the EfiBootManagerGetBootManagerM= enu() - call in BdsEntry(). -**/ -VOID -BdsBootManagerMenuLoop ( - IN EFI_BOOT_MANAGER_LOAD_OPTION *BootManagerMenu - ) -{ - EFI_INPUT_KEY Key; - - // - // Normally BdsDxe does not print anything to the system console, but th= is is - // a last resort -- the end-user will likely not see any DEBUG messages - // logged in this situation. - // - // AsciiPrint() will NULL-check gST->ConOut internally. We check gST->Co= nIn - // here to see if it makes sense to request and wait for a keypress. - // - if (gST->ConIn !=3D NULL) { - AsciiPrint ( - "%a: No bootable option or device was found.\n" - "%a: Press any key to enter the Boot Manager Menu.\n", - gEfiCallerBaseName, - gEfiCallerBaseName - ); - BdsWaitForSingleEvent (gST->ConIn->WaitForKey, 0); - - // - // Drain any queued keys. - // - while (!EFI_ERROR (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key))) { - // - // just throw away Key - // - } - } - - for (;;) { - EfiBootManagerBoot (BootManagerMenu); - } -} - /** =20 Service routine for BdsInstance->Entry(). Devices are connected, the @@ = -1088,10 +1039,20 @@ BdsEntry ( } =20 // - // If BootManagerMenu is available, fall back to it indefinitely. + // Inform the platform that we're unable to boot. The platform may=20 + enter // BootManagerMenu with the public EfiBootManagerBoot()=20 + interface, if so // desired. // - if (BootManagerMenuStatus !=3D EFI_NOT_FOUND) { - BdsBootManagerMenuLoop (&BootManagerMenu); + Status =3D EfiBootManagerUnableToBoot (); if (EFI_ERROR (Status) &&=20 + (BootManagerMenuStatus !=3D EFI_NOT_FOUND)) { + // + // The platform didn't register a callback; fall back to BootManagerMe= nu + // internally, indefinitely. + // + =20 + while (TRUE) { + EfiBootManagerBoot (&BootManagerMenu); + } } =20 DEBUG ((EFI_D_ERROR, "[Bds] Unable to boot!\n")); -- 2.16.1.windows.1