From: Ming Huang <ming.huang@linaro.org>
To: Leif Lindholm <leif.lindholm@linaro.org>
Cc: linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org,
star.zeng@intel.com, eric.dong@intel.com, ruiyu.ni@intel.com,
dann.frazier@canonical.com, ard.biesheuvel@linaro.org,
michael.d.kinney@intel.com, liming.gao@intel.com,
wanghuiqiang@huawei.com, huangming23@huawei.com,
zhangjinsong2@huawei.com, huangdaode@hisilicon.com,
waip23@126.com, Jian J Wang <jian.j.wang@intel.com>,
Hao Wu <hao.a.wu@intel.com>, Ray Ni <ray.ni@intel.com>
Subject: Re: [MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue
Date: Tue, 19 Mar 2019 12:01:51 +0800 [thread overview]
Message-ID: <2f560ccb-0885-2be2-fa11-ec7121ebf07a@linaro.org> (raw)
In-Reply-To: <20190318124232.67pblu6tbdi47g2w@bivouac.eciton.net>
On 3/18/2019 8:42 PM, Leif Lindholm wrote:
> +MdeModulePkg maintainers (you added MdePkg maintainers to cc)
>
> This looks like an improvement to me.
>
> Am I correct in guessing this behaviour refers to some specific corner
> case of a USB CDROM emulated from a BMC?
Yes, I found this issue with a USB CDROM emulated from a BMC.
I guess have the same symptom with physical USB CDROM.
Thanks
>
> On Mon, Feb 25, 2019 at 05:10:52PM +0800, Ming Huang wrote:
>> The system environment: virtual-CDROM(USB interface) via BMC, insert a
>> iso file to CDROM, like ubuntu-18.04.1-server-arm64.iso, change CDROM
>> to first boot option.
>> With release version bios, disconnecting CDROM when boot to
>> "1 seconds left, Press Esc or F2 to enter Setup"
>> then system will get a exception.
>>
>> The root cause is the EFI_BLOCK_IO_PROTOCOL for UsbMass will be uninstalled
>> in this situation after print some transfer error. The status will be
>> invalid parameter. This line will get a exception for BlockIo not point
>> to right address:
>> AllocatePool (BlockIo->Media->BlockSize)
>> So, here need to judge the status not using ASSERT_EFI_ERROR.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ming Huang <ming.huang@linaro.org>
>> ---
>> MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
>> index d5957db610d9..c2f1c651b02f 100644
>> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
>> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
>> @@ -1068,7 +1068,9 @@ BmExpandMediaDevicePath (
>> // Block IO read/write will success.
>> //
>> Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **) &BlockIo);
>> - ASSERT_EFI_ERROR (Status);
>> + if (EFI_ERROR (Status)) {
>
> It would still be worth including an ASSERT here, to let DEBUG builds
> report on point of failure rather than several steps up the chain.
>
> /
> Leif
>
>> + return NULL;
>> + }
>> Buffer = AllocatePool (BlockIo->Media->BlockSize);
>> if (Buffer != NULL) {
>> BlockIo->ReadBlocks (
>> --
>> 2.9.5
>>
next prev parent reply other threads:[~2019-03-19 4:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-25 9:10 [MdeModulePkg/Library v1 0/1] Fix exception issue while UsbMass block io uninstalled Ming Huang
2019-02-25 9:10 ` [MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue Ming Huang
2019-03-18 12:42 ` Leif Lindholm
2019-03-19 2:25 ` Wu, Hao A
2019-03-19 4:13 ` Ming Huang
2019-03-19 5:56 ` Wu, Hao A
2019-03-19 12:26 ` Ming Huang
2019-03-19 4:01 ` Ming Huang [this message]
2019-03-19 10:00 ` Leif Lindholm
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=2f560ccb-0885-2be2-fa11-ec7121ebf07a@linaro.org \
--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