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::52b; helo=mail-pg1-x52b.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) (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 CBBBA211CAC81 for ; Mon, 25 Feb 2019 01:11:02 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id e17so2160335pgd.2 for ; Mon, 25 Feb 2019 01:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=tOK/ikHHPjn2efHRg8hY55euXQqjhoUBnpKUdUI5U/g=; b=zOfCT6fsEVW+cXWg0RlMQDmxJo7pwtNxCF0vd65a1jzr4fEuilSg4GX6zeDhad/LcR DCmMx2csMc3g52rdUUaPquQoyPaqd8fn7G+1OvhrVLSdu28++827myJX2SnU8aTGcOt8 xgdhYFE98das0UTdox6oOfWCOgoaNADNmfabBR5P0GZwdlfg1L4+f2PkmGIT3oMjDB+7 chBmVGvOLoZ6+3mAH4Fk8jnDgB5M2FwVsn//sPIyJafBArbhZuYVH12d/QLfIejgvKmS KtxsfmcTB25U2LUayyvFKS+Ns1ZK8Q5aMNuvdgiOBZtuRZwh/HOrdLkmDShDB3Lm9E4Q 69VA== 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=R0wQNY9puLwvqq17rGdqwkomXQsX/SUPcj0xuwa/MvhXB2XnUaWZMyDN+BauS3Da0q hHI0vMr4gpvTjVv1mQhrkhPi6C6ChlNflR0d+1kXJoAw9uPdL8IYhRnKoCU3mkIpWFFS fkzvWkoCTZhFjRvU4N94TSb2wYXtEPw/j/7uIPbSTVbiUZP08yzenhMWdGg8fVBJf/YO 7cKAOvFUcV915x24Obv9JhtKn3nvww/RZh3I7ZeEkt1A8/jsSKYiMJwkr84BaRm7mXnM JRAcG7ynpvAdu9G/RPFaBBzA1c2PDyStWdFtVbRijMvEDVrh5Va+o9gJoqT1/YDZs0j6 lQZw== X-Gm-Message-State: AHQUAubxF7NSjtAy9SoyKShdkGj5hcuJdM/NpCkWbwwDYLZbN6enOP4f S6CpBHsNeX30EC3ZwO3WKnciHw== X-Google-Smtp-Source: AHgI3Iadx0473PqXNBUaoy48ECKsjleT8JfhmJEuJ+1CAN1e+XbDibAqIcnRkvSjGZhSAJyCrUqsSQ== 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 Cc: leif.lindholm@linaro.org, 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, Ming Huang 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 Subject: [MdeModulePkg/Library v1 0/1] Fix exception issue while UsbMass block io uninstalled 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: Mon, 25 Feb 2019 09:11:03 -0000 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(-) -- 2.9.5