From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] MdeModulePkg/UefiBootManagerLib: Remove assertion
Date: Wed, 22 Nov 2017 08:14:16 +0000 [thread overview]
Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AA27FF2@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20171120051411.36284-1-ruiyu.ni@intel.com>
Reviewed-by: Jiewen.yao@intel.com
> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Monday, November 20, 2017 1:14 PM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen <jiewen.yao@intel.com>
> Subject: [PATCH] MdeModulePkg/UefiBootManagerLib: Remove assertion
>
> EfiBootManagerStartHotkeyService() asserts when "BootOptionSupport"
> variable doesn't exist.
>
> In fact, though "BootOptionSupport" variable is set in BdsDxe
> module, it's possible that the variable is deleted by
> PlatformBootManagerBeforeConsole().
>
> The patch removes the assertion and adds code to handle the case.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> ---
> MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c
> b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c
> index efad073880..d18ce02eb3 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c
> @@ -870,13 +870,13 @@ EfiBootManagerStartHotkeyService (
> EFI_EVENT Event;
> UINT32 *BootOptionSupport;
>
> - Status = GetEfiGlobalVariable2
> (EFI_BOOT_OPTION_SUPPORT_VARIABLE_NAME, (VOID **)
> &BootOptionSupport, NULL);
> - ASSERT (BootOptionSupport != NULL);
> -
> - if ((*BootOptionSupport & EFI_BOOT_OPTION_SUPPORT_KEY) != 0) {
> - mBmHotkeySupportCount = ((*BootOptionSupport &
> EFI_BOOT_OPTION_SUPPORT_COUNT) >> LowBitSet32
> (EFI_BOOT_OPTION_SUPPORT_COUNT));
> + GetEfiGlobalVariable2 (EFI_BOOT_OPTION_SUPPORT_VARIABLE_NAME,
> (VOID **) &BootOptionSupport, NULL);
> + if (BootOptionSupport != NULL) {
> + if ((*BootOptionSupport & EFI_BOOT_OPTION_SUPPORT_KEY) != 0) {
> + mBmHotkeySupportCount = ((*BootOptionSupport &
> EFI_BOOT_OPTION_SUPPORT_COUNT) >> LowBitSet32
> (EFI_BOOT_OPTION_SUPPORT_COUNT));
> + }
> + FreePool (BootOptionSupport);
> }
> - FreePool (BootOptionSupport);
>
> if (mBmHotkeySupportCount == 0) {
> DEBUG ((EFI_D_INFO, "Bds: BootOptionSupport NV variable forbids
> starting the hotkey service.\n"));
> --
> 2.15.0.gvfs.1.preview.4
prev parent reply other threads:[~2017-11-22 8:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 5:14 [PATCH] MdeModulePkg/UefiBootManagerLib: Remove assertion Ruiyu Ni
2017-11-22 8:14 ` Yao, Jiewen [this message]
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=74D8A39837DF1E4DA445A8C0B3885C503AA27FF2@shsmsx102.ccr.corp.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