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.24; helo=mga09.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 EFD5220886F29 for ; Fri, 15 Feb 2019 00:52:07 -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 orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2019 00:52:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,372,1544515200"; d="scan'208";a="122644972" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by fmsmga007.fm.intel.com with ESMTP; 15 Feb 2019 00:52:05 -0800 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Jian J Wang , Hao Wu , Ruiyu Ni , Laszlo Ersek , Sean Brogan Date: Fri, 15 Feb 2019 16:51:41 +0800 Message-Id: <20190215085141.64244-3-dandan.bi@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 In-Reply-To: <20190215085141.64244-1-dandan.bi@intel.com> References: <20190215085141.64244-1-dandan.bi@intel.com> Subject: [patch 2/2] MdeModulePkg/BmBoot: Report status when fail to load/start boot option X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2019 08:52:08 -0000 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1398 According to PI1.7 Spec, report extended data describing an EFI_STATUS return value along with EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR and EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED status code when fail to load or start boot option image. Cc: Jian J Wang Cc: Hao Wu Cc: Ruiyu Ni Cc: Laszlo Ersek Cc: Sean Brogan Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi --- .../Library/UefiBootManagerLib/BmBoot.c | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c index 6444fb43eb..9be1633b74 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -1818,15 +1818,20 @@ EfiBootManagerBoot ( FreePool (FilePath); } if (EFI_ERROR (Status)) { // - // Report Status Code to indicate that the failure to load boot option + // Report Status Code with the failure status to indicate that the failure to load boot option // - REPORT_STATUS_CODE ( + REPORT_STATUS_CODE_EX ( EFI_ERROR_CODE | EFI_ERROR_MINOR, - (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR) + (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR), + 0, + NULL, + NULL, + &Status, + sizeof (EFI_STATUS) ); BootOption->Status = Status; // // Destroy the RAM disk // @@ -1902,15 +1907,20 @@ EfiBootManagerBoot ( Status = gBS->StartImage (ImageHandle, &BootOption->ExitDataSize, &BootOption->ExitData); DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Image Return Status = %r\n", Status)); BootOption->Status = Status; if (EFI_ERROR (Status)) { // - // Report Status Code to indicate that boot failure + // Report Status Code with the failure status to indicate that boot failure // - REPORT_STATUS_CODE ( + REPORT_STATUS_CODE_EX ( EFI_ERROR_CODE | EFI_ERROR_MINOR, - (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED) + (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED), + 0, + NULL, + NULL, + &Status, + sizeof (EFI_STATUS) ); } PERF_END_EX (gImageHandle, "BdsAttempt", NULL, 0, (UINT32) OptionNumber); // -- 2.18.0.windows.1