From patchwork Mon Feb 25 09:10:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 159156 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp1802247jad; Mon, 25 Feb 2019 01:11:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IYV2kFdUTAgedMV9vVK7fwaFHQCeYpT2dIGZBY9Zc0xqYes9kxCrX79tkyzrXkmwLhNVE4u X-Received: by 2002:ae9:e702:: with SMTP id m2mr12451883qka.279.1551085873408; Mon, 25 Feb 2019 01:11:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551085873; cv=none; d=google.com; s=arc-20160816; b=Kw5dhAd+zVpcd2ddTDrr3oB7HEVBTizVyr8PMP/P0Q0eAi3B0zfdBQcmoVKJoVfgId lPppZRncvu7RGUdE0RSQMmsl8zB2JG0803Y7BlzmLp/QBJVCeGGLA5JpSuOH6Yu5Edtk kjxH9WXG9uPtPWPw8kfDSpdnGiCQYlhuKm0kEG3VllBso4e+Jv5tqfpffCVffKSC3bSq YLyECecYBWWsyD3foaR445noOMmhnUia43SiC11OM6J45LwIhfx8JRF6NGcCiKAH/aLh x9sSPWs4sFHFp+Hc5a7pFfYxRTUUblv9eM87fK9QRDpooDPGOphaGmF0PWlaNk1DgcLV +/MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from:delivered-to; bh=5XO5aWcdlT+3o8wtchDIUUJ4kEAJLsNo+4HrRMi8UDg=; b=0J83+M/ym3o84n33WwBq7JFWacxNWm1s/eJgtZylgU8AZqZPD9ChH6roIeIQQuxdFn +mHpvraOq70eIliDz1QBeM9BYQVnvOwtDOYlBBZQvYzOH0uYkOP3emxH8J+VDcOzZ7um gLsuyRBQlBYNwyubrmg21trJgAAZeI/uBJpzKtORf5uZNy+NQzOsmKFu9WFXP9HA8bSR kiCq3VWGsRf4uaVMm7Aq1LnnGXUcogGKWf3rPWhfm5Tx513Y7rmkaWtOvIpBtKGQmm6B 3GEaLQO9120WtTgarGpskHew6AsFMxv6+LKCU/Bz+w4tcG2k2DuATFWdGEARNg8nR2V1 Agqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.158.76.221 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org Return-Path: Received: from lists.linaro.org (ec2-54-158-76-221.compute-1.amazonaws.com. [54.158.76.221]) by mx.google.com with ESMTPS id 16si3904649qvh.182.2019.02.25.01.11.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 01:11:13 -0800 (PST) Received-SPF: pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.158.76.221 as permitted sender) client-ip=54.158.76.221; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.158.76.221 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org Received: from lists.linaro.org (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id A22B260BF5; Mon, 25 Feb 2019 09:11:11 +0000 (UTC) Received: by lists.linaro.org (Postfix, from userid 109) id 742C160EAD; Mon, 25 Feb 2019 09:11:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ip-10-150-125-211.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=disabled version=3.4.2 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id E2457608E0; Mon, 25 Feb 2019 09:11:06 +0000 (UTC) X-Original-To: linaro-uefi@lists.linaro.org Delivered-To: linaro-uefi@lists.linaro.org Received: from lists.linaro.org (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C7D6260786 for ; Mon, 25 Feb 2019 09:11:04 +0000 (UTC) Received: by lists.linaro.org (Postfix, from userid 109) id AC518608E0; Mon, 25 Feb 2019 09:11:04 +0000 (UTC) Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by lists.linaro.org (Postfix) with ESMTPS id 710F460786 for ; Mon, 25 Feb 2019 09:11:03 +0000 (UTC) Received: by mail-pg1-f182.google.com with SMTP id m2so4210407pgl.5 for ; Mon, 25 Feb 2019 01:11:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=tOK/ikHHPjn2efHRg8hY55euXQqjhoUBnpKUdUI5U/g=; b=WFrjlhR6Zc+QPq8dGeiQJo/aX0zO4rrPn0Xe8Z4V7pxoH3Qsm3v60ARcoV+vDoLm1N hq1lwporcpUrGEUyzFk+T2BgdCQ3IDobGEkQw98zo1REncddq5Cq4cv8UfpTYPjkUV9z 25EWqXxB7cI2UxcMmzQRN9SF45HB7e7q7oJtxx6fzaZaHDdTiqBD4eteP5B1VI7Qf6SK lw/UyW5RO4OiMmCJj+iNZfEoSrWIIC1irC+0gM3XrHzp0vsiTCY1W+jMa9Xdyijckf46 wsE3/4aHf3OwGLDaGGGsFfEdi90w+xR48J3jqdKaVTvXXL3sa353XVOVQPSa/2p64NFF ToHw== X-Gm-Message-State: AHQUAub92QUzDa2t8nvGIgScs/nRtSys79JrEcnO0oHw6Zjyl9m3V7wi VE5zQiFd+A2q2HyvodAeHR+IkQ+kjdDDNQ== X-Received: by 2002:a65:468f:: with SMTP id h15mr358443pgr.391.1551085862089; Mon, 25 Feb 2019 01:11:02 -0800 (PST) Received: from localhost.localdomain ([203.160.91.226]) by smtp.gmail.com with ESMTPSA id z67sm15488716pfi.152.2019.02.25.01.10.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Feb 2019 01:11:01 -0800 (PST) From: Ming Huang To: 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 Date: Mon, 25 Feb 2019 17:10:51 +0800 Message-Id: <20190225091052.25461-1-ming.huang@linaro.org> X-Mailer: git-send-email 2.9.5 X-Virus-Scanned: ClamAV using ClamSMTP Cc: huangming23@huawei.com, zhangjinsong2@huawei.com, liming.gao@intel.com, michael.d.kinney@intel.com, waip23@126.com, wanghuiqiang@huawei.com, huangdaode@hisilicon.com Subject: [Linaro-uefi] [MdeModulePkg/Library v1 0/1] Fix exception issue while UsbMass block io uninstalled X-BeenThere: linaro-uefi@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "For discussions about Linaro-related UEFI development. Not a substitute for edk2-devel." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-uefi-bounces@lists.linaro.org Sender: "Linaro-uefi" X-Virus-Scanned: ClamAV using ClamSMTP Another exception issue while UsbMass block io uninstalled when boot to grub: The system environment: virtual-CDROM(USB interface) via BMC, insert a iso file to virtual-CDROM, like ubuntu-18.04.1-server-arm64.iso, change virtaul-CDROM to first boot option. Disconnecting virtual-CDROM when boot to grub menu "Install Ubuntu Server" then select "Install Ubuntu Server", system will also get exception. The root cause is the EFI_BLOCK_IO_PROTOCOL for USBMass will be uninstalled in this situation after print some transfer error(see blow), but grub will still use the block io which had initialized by grub_efidisk_init() in efidisk.c. When run m->io_align in grub_efidisk_open (): if (m->io_align & (m->io_align - 1)) grub will get exception for the EFI_BLOCK_IO_PROTOCOL had uninstalled and the memory had set to 0xAF by PcdDebugClearMemoryValue. This exception look like the matching problem grub and uefi. Is it need to do something in uefi side or grub side? The open source grub grub_efidisk_open function chunk: m = d->block_io->media; /* FIXME: Probably it is better to store the block size in the disk, and total sectors should be replaced with total blocks. */ grub_dprintf ("efidisk", "m = %p, last block = %llx, block size = %x, io align = %x\n", m, (unsigned long long) m->last_block, m->block_size, m->io_align); /* Ensure required buffer alignment is a power of two (or is zero). */ if (m->io_align & (m->io_align - 1)) USB transfer error log: UsbBootExecCmd: Device Error to Exec 0x0 Cmd (Result = 1) EhcExecTransfer: transfer failed with 40 EhcBulkTransfer: error - Device Error, transfer - 40 UsbBotExecCommand: UsbBotSendCommand (Device Error) UsbBootRequestSense: (Device Error) CmdResult=0x1 UsbBootDetectMedia: UsbBootIsUnitReady (Device Error) ----------------------------------------------------------- Ming Huang (1): MdeModulePkg/UefiBootManangerLib: Fix exception issue MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)