From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::52f; helo=mail-pg1-x52f.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CFA162194EB77 for ; Mon, 18 Mar 2019 21:02:06 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id h8so12905230pgp.6 for ; Mon, 18 Mar 2019 21:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Pq3O+S/wtwL90QrAYvA4gGI+2D7CpYHIQ4WEhTvYUI4=; b=GsAYfJB1s4XNUmsYb7sET4jW1/7LsNCf/PQAPVAIXl8q4a/A4hn7Eh3V7v4FKdUz7x To3v8N6RJb+6t0pZKH0SpSaU89VW6m1aX55hZ6ckvBqXDlzdWmYwOQooe3m97qozyA58 Kz6UX8A5QcUfJ0bwtXp4Lc8sSave52U6cxSl0IuBwlPSZhEQnBep6jnjDz54Fcc7SFaw jBNB0ITZEmDQ6X8PyMV8M4+1XCMtshT4q84JT/TJtyMeitdB/PLH4Dw49fYHmTkvb0/x Ge1yaRNHc5J4e4+hid7cta3j40KZ9YKYgh/PseNeb8Q2nasOkbRjVuOzBzAoWIp6Gt6c DgPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Pq3O+S/wtwL90QrAYvA4gGI+2D7CpYHIQ4WEhTvYUI4=; b=ilJteZdSSPJ3/GDgQvVCiq6u7bBgL/9gK7TXuqcxR3VaNnVQAM4yiMZV7y5cbgf/Ny ShcLisTpmeIJEPZE1/H8K1MVnIgKbG40Pke4eNCnUBZqS4zE9ffMOZEiAsmtY5LGwyiE tTxDSXhW8hvPyaf0L+zU2GF/NmphS4yT8lj7jhVen46zqTGwGzirknvtZpLeVnfAAjbs 9UfBK/MZ6C7E4UDsp6B26io8elUZeecs0Viu1cB3mW37wvMf1cxBT+jh4gKAy+TNlaM7 R5df1BqBppOOl/drdK3g7/obUd2YHA1UW0xQ19i/jRCXaiihBpbKa0iWtCppB63xmTKr Pabg== X-Gm-Message-State: APjAAAWj6R6WjfoJZmL4UYHdby8bGawhnLIeVK6i/ALmH8Qa+7T7XOgn z9nnFMnroLqagEwNAdmvjhQ2Cw== X-Google-Smtp-Source: APXvYqyuugML3tOIJUCsdQn32XYNuHkdK6cBo4l2ELzLGRJvfPqR52ecB3dOr7DOxA8wZfRNanLH8A== X-Received: by 2002:a17:902:968a:: with SMTP id n10mr23620675plp.283.1552968125682; Mon, 18 Mar 2019 21:02:05 -0700 (PDT) Received: from [10.140.0.66] ([64.64.108.204]) by smtp.gmail.com with ESMTPSA id g3sm14666669pgg.41.2019.03.18.21.01.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 21:02:04 -0700 (PDT) To: Leif Lindholm 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 , Hao Wu , Ray Ni References: <20190225091052.25461-1-ming.huang@linaro.org> <20190225091052.25461-2-ming.huang@linaro.org> <20190318124232.67pblu6tbdi47g2w@bivouac.eciton.net> From: Ming Huang Message-ID: <2f560ccb-0885-2be2-fa11-ec7121ebf07a@linaro.org> Date: Tue, 19 Mar 2019 12:01:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20190318124232.67pblu6tbdi47g2w@bivouac.eciton.net> Subject: Re: [MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue 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: Tue, 19 Mar 2019 04:02:07 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 >> --- >> 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 >>