public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [MdeModulePkg/Library v1 0/1] Fix exception issue while UsbMass block io uninstalled
@ 2019-02-25  9:10 Ming Huang
  2019-02-25  9:10 ` [MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue Ming Huang
  0 siblings, 1 reply; 9+ messages in thread
From: Ming Huang @ 2019-02-25  9:10 UTC (permalink / raw)
  To: linaro-uefi, edk2-devel, star.zeng, eric.dong, ruiyu.ni,
	dann.frazier
  Cc: leif.lindholm, ard.biesheuvel, michael.d.kinney, liming.gao,
	wanghuiqiang, huangming23, zhangjinsong2, huangdaode, waip23,
	Ming Huang

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-03-19 12:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2019-03-19 10:00       ` Leif Lindholm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox