public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Dandan Bi <dandan.bi@intel.com>
To: edk2-devel@lists.01.org
Cc: Jian J Wang <jian.j.wang@intel.com>, Hao Wu <hao.a.wu@intel.com>,
	Ruiyu Ni <ruiyu.ni@intel.com>, Laszlo Ersek <lersek@redhat.com>,
	Sean Brogan <sean.brogan@microsoft.com>
Subject: [patch 2/2] MdeModulePkg/BmBoot: Report status when fail to load/start boot option
Date: Fri, 15 Feb 2019 16:51:41 +0800	[thread overview]
Message-ID: <20190215085141.64244-3-dandan.bi@intel.com> (raw)
In-Reply-To: <20190215085141.64244-1-dandan.bi@intel.com>

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 <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 .../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



  parent reply	other threads:[~2019-02-15  8:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15  8:51 [patch 0/2] Report error status when fail to load/start boot option Dandan Bi
2019-02-15  8:51 ` [patch 1/2] MdePkg/StatusCodeDataTypeId.h: Add new definition per PI1.7 Spec Dandan Bi
2019-02-15  8:51 ` Dandan Bi [this message]
2019-02-20  1:19   ` [patch 2/2] MdeModulePkg/BmBoot: Report status when fail to load/start boot option Laszlo Ersek
2019-02-20  1:36     ` Laszlo Ersek
2019-02-20  2:21     ` Ni, Ray
2019-02-20  9:24       ` Laszlo Ersek
2019-02-20 17:19         ` Doran, Mark
2019-02-21  8:55           ` Laszlo Ersek
2019-02-20  2:35     ` Bi, Dandan
2019-02-15 13:40 ` [patch 0/2] Report error " Laszlo Ersek
2019-02-15 13:58   ` Ni, Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190215085141.64244-3-dandan.bi@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox