RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1373329 - Hang occur when input "exit" in UEFI Shell
Summary: Hang occur when input "exit" in UEFI Shell
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ovmf
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Laszlo Ersek
QA Contact: aihua liang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-06 02:55 UTC by aihua liang
Modified: 2016-09-08 16:52 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-07 03:05:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Screen cut of UEFI Shell hang (106.32 KB, image/png)
2016-09-06 03:09 UTC, aihua liang
no flags Details

Description aihua liang 2016-09-06 02:55:49 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 aihua liang 2016-09-06 03:07:53 UTC
Description of problem:
  System hang when input "exit" in UEFI Shell
 
Version-Release number of selected component (if applicable):
  Kernel version:3.10.0-504.el7.x86_64
  qemu-kvm-rhev version:qemu-kvm-rhev-2.6.0-22.el7.x86_64
  OVMF version:OVMF-20160608-3.git988715a.el7.noarch
 
How reproducible:
  100%
 
Steps to Reproduce:
 1.Start UEFI Shell using cmds:
/usr/libexec/qemu-kvm -name rhel7 \
-machine q35,accel=kvm,usb=off,vmport=off \
-cpu SandyBridge \
-m 8192 \
-realtime mlock=off \
-smp 6 \
-uuid 1534fa42-4818-4493-9f67-eee5ba758385 \
-no-user-config -nodefaults \
-chardev socket,id=qmp_id_catch_monitor,path=/var/tmp/test1,server,nowait \
-mon chardev=qmp_id_catch_monitor,id=monitor,mode=control \
-no-hpet \
-boot menu=on,splash-time=12000 \
-vga qxl \
-monitor stdio \
-vnc 0:2 \
-netdev tap,id=hostnet10 \
-device virtio-net-pci,netdev=hostnet10,id=net10,mac=58:54:00:49:b2:5f,bootindex=1 \
-spice ipv4,port=5000,disable-ticketing \
-enable-kvm \
-global ICH9-LPC.disable_s3=0 \
-drive file=/usr/share/OVMF/OVMF_CODE.secboot.fd,if=pflash,format=raw,readonly=on \
-drive file=/usr/share/OVMF/OVMF_Client_VARS.fd,if=pflash,format=raw \
-device ahci,id=ahci \
-global driver=cfi.pflash01,property=secure,value=on \
-cdrom /usr/share/OVMF/UefiShell.iso \
-chardev socket,id=ovmf_log,path=/var/tmp/ovmf_log,server,nowait \
-device isa-debugcon,chardev=ovmf_log,iobase=0x402 \

 2. Wait until it enters UEFI Shell mode.

 3. Input "exit" to return to Boot Setup interface.

 
Actual results:
  Hang with no response.
 a. Log info:
[root@dhcp-8-210 home]# nc -U /var/tmp/ovmf_log
[Bds]BdsWait(10)..Zzzz...
[Bds]BdsWait(9)..Zzzz...
[Bds]BdsWait(8)..Zzzz...
[Bds]BdsWait(7)..Zzzz...
[Bds]BdsWait(6)..Zzzz...
[Bds]BdsWait(5)..Zzzz...
[Bds]BdsWait(4)..Zzzz...
[Bds]BdsWait(3)..Zzzz...
[Bds]BdsWait(2)..Zzzz...
[Bds]BdsWait(1)..Zzzz...
[Bds]Exit the waiting!
[Bds]Stop Hotkey Service!
[Bds]UnregisterKeyNotify: 000C/0000 Success
[Bds]UnregisterKeyNotify: 0017/0000 Success
[Bds]UnregisterKeyNotify: 0000/000D Success
SmmInstallProtocolInterface: 6E057ECF-FA99-4F39-95BC-59F9921D17E4 0
MemoryAttributesTable:
  Version              - 0x00000001
  NumberOfEntries      - 0x0000001F
  DescriptorSize       - 0x00000030
Entry (0x7E646028)
  Type              - 0x6
  PhysicalStart     - 0x000000007E4E8000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000005
  Attribute         - 0x8000000000004000
Entry (0x7E646058)
  Type              - 0x5
  PhysicalStart     - 0x000000007E4ED000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000001
  Attribute         - 0x8000000000004000
Entry (0x7E646088)
  Type              - 0x5
  PhysicalStart     - 0x000000007E4EE000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000007
  Attribute         - 0x8000000000020000
Entry (0x7E6460B8)
  Type              - 0x5
  PhysicalStart     - 0x000000007E4F5000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000002
  Attribute         - 0x8000000000004000
Entry (0x7E6460E8)
  Type              - 0x6
  PhysicalStart     - 0x000000007E4F7000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000005
  Attribute         - 0x8000000000004000
Entry (0x7E646118)
  Type              - 0x5
  PhysicalStart     - 0x000000007E4FC000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000001
  Attribute         - 0x8000000000004000
Entry (0x7E646148)
  Type              - 0x5
  PhysicalStart     - 0x000000007E4FD000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000005
  Attribute         - 0x8000000000020000
Entry (0x7E646178)
  Type              - 0x5
  PhysicalStart     - 0x000000007E502000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000002
  Attribute         - 0x8000000000004000
Entry (0x7E6461A8)
  Type              - 0x6
  PhysicalStart     - 0x000000007E524000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000005
  Attribute         - 0x8000000000004000
Entry (0x7E6461D8)
  Type              - 0x5
  PhysicalStart     - 0x000000007E529000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000001
  Attribute         - 0x8000000000004000
Entry (0x7E646208)
  Type              - 0x5
  PhysicalStart     - 0x000000007E52A000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x000000000000000A
  Attribute         - 0x8000000000020000
Entry (0x7E646238)
  Type              - 0x5
  PhysicalStart     - 0x000000007E534000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000002
  Attribute         - 0x8000000000004000
Entry (0x7E646268)
  Type              - 0x6
  PhysicalStart     - 0x000000007E536000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000003
  Attribute         - 0x8000000000004000
Entry (0x7E646298)
  Type              - 0x5
  PhysicalStart     - 0x000000007E539000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000001
  Attribute         - 0x8000000000004000
Entry (0x7E6462C8)
  Type              - 0x5
  PhysicalStart     - 0x000000007E53A000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000009
  Attribute         - 0x8000000000020000
Entry (0x7E6462F8)
  Type              - 0x5
  PhysicalStart     - 0x000000007E543000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000002
  Attribute         - 0x8000000000004000
Entry (0x7E646328)
  Type              - 0x5
  PhysicalStart     - 0x000000007E59D000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000001
  Attribute         - 0x8000000000004000
Entry (0x7E646358)
  Type              - 0x5
  PhysicalStart     - 0x000000007E59E000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x000000000000000D
  Attribute         - 0x8000000000020000
Entry (0x7E646388)
  Type              - 0x5
  PhysicalStart     - 0x000000007E5AB000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000002
  Attribute         - 0x8000000000004000
Entry (0x7E6463B8)
  Type              - 0x5
  PhysicalStart     - 0x000000007F6A3000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000008
  Attribute         - 0x8000000000004000
Entry (0x7E6463E8)
  Type              - 0x5
  PhysicalStart     - 0x000000007F6AB000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000006
  Attribute         - 0x8000000000020000
Entry (0x7E646418)
  Type              - 0x5
  PhysicalStart     - 0x000000007F6B1000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000003
  Attribute         - 0x8000000000004000
Entry (0x7E646448)
  Type              - 0x5
  PhysicalStart     - 0x000000007F6B4000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000006
  Attribute         - 0x8000000000020000
Entry (0x7E646478)
  Type              - 0x5
  PhysicalStart     - 0x000000007F6BA000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000003
  Attribute         - 0x8000000000004000
Entry (0x7E6464A8)
  Type              - 0x5
  PhysicalStart     - 0x000000007F6BD000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000007
  Attribute         - 0x8000000000020000
Entry (0x7E6464D8)
  Type              - 0x5
  PhysicalStart     - 0x000000007F6C4000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000003
  Attribute         - 0x8000000000004000
Entry (0x7E646508)
  Type              - 0x5
  PhysicalStart     - 0x000000007F6C7000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x000000000000000A
  Attribute         - 0x8000000000020000
Entry (0x7E646538)
  Type              - 0x5
  PhysicalStart     - 0x000000007F6D1000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000002
  Attribute         - 0x8000000000004000
Entry (0x7E646568)
  Type              - 0x6
  PhysicalStart     - 0x000000007F6D3000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000024
  Attribute         - 0x8000000000004000
Entry (0x7E646598)
  Type              - 0x6
  PhysicalStart     - 0x000000007F7D0000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000020
  Attribute         - 0x8000000000004000
Entry (0x7E6465C8)
  Type              - 0x6
  PhysicalStart     - 0x00000000FFE00000
  VirtualStart      - 0x0000000000000000
  NumberOfPages     - 0x0000000000000200
  Attribute         - 0x8000000000004000
InstallProtocolInterface: 245DCA21-FB7B-11D3-8F01-00A0C969723B 7E8220E0
MnpAddFreeTxBuf: Add TxBufWrap 7E640018, TxBuf 7E640041
MnpAddFreeTxBuf: Add TxBufWrap 7E640698, TxBuf 7E6406C1
MnpAddFreeTxBuf: Add TxBufWrap 7E63F018, TxBuf 7E63F041
MnpAddFreeTxBuf: Add TxBufWrap 7E63F698, TxBuf 7E63F6C1
MnpAddFreeTxBuf: Add TxBufWrap 7E63E018, TxBuf 7E63E041
MnpAddFreeTxBuf: Add TxBufWrap 7E63E698, TxBuf 7E63E6C1
MnpAddFreeTxBuf: Add TxBufWrap 7E63D018, TxBuf 7E63D041
MnpAddFreeTxBuf: Add TxBufWrap 7E63D698, TxBuf 7E63D6C1
MnpAddFreeTxBuf: Add TxBufWrap 7E63C018, TxBuf 7E63C041
MnpAddFreeTxBuf: Add TxBufWrap 7E63C698, TxBuf 7E63C6C1
MnpAddFreeTxBuf: Add TxBufWrap 7E63B018, TxBuf 7E63B041
MnpAddFreeTxBuf: Add TxBufWrap 7E63B698, TxBuf 7E63B6C1
MnpAddFreeTxBuf: Add TxBufWrap 7E63A018, TxBuf 7E63A041
MnpAddFreeTxBuf: Add TxBufWrap 7E63A698, TxBuf 7E63A6C1
MnpAddFreeTxBuf: Add TxBufWrap 7E639018, TxBuf 7E639041
MnpAddFreeTxBuf: Add TxBufWrap 7E639698, TxBuf 7E6396C1
MnpAddFreeTxBuf: Add TxBufWrap 7E638018, TxBuf 7E638041
MnpAddFreeTxBuf: Add TxBufWrap 7E638698, TxBuf 7E6386C1
MnpAddFreeTxBuf: Add TxBufWrap 7E637018, TxBuf 7E637041
MnpAddFreeTxBuf: Add TxBufWrap 7E637698, TxBuf 7E6376C1
MnpAddFreeTxBuf: Add TxBufWrap 7E636018, TxBuf 7E636041
MnpAddFreeTxBuf: Add TxBufWrap 7E636698, TxBuf 7E6366C1
MnpAddFreeTxBuf: Add TxBufWrap 7E635018, TxBuf 7E635041
MnpAddFreeTxBuf: Add TxBufWrap 7E635698, TxBuf 7E6356C1
MnpAddFreeTxBuf: Add TxBufWrap 7E634018, TxBuf 7E634041
MnpAddFreeTxBuf: Add TxBufWrap 7E634698, TxBuf 7E6346C1
MnpAddFreeTxBuf: Add TxBufWrap 7E633018, TxBuf 7E633041
MnpAddFreeTxBuf: Add TxBufWrap 7E633698, TxBuf 7E6336C1
MnpAddFreeTxBuf: Add TxBufWrap 7E632018, TxBuf 7E632041
MnpAddFreeTxBuf: Add TxBufWrap 7E632698, TxBuf 7E6326C1
MnpAddFreeTxBuf: Add TxBufWrap 7E631018, TxBuf 7E631041
MnpAddFreeTxBuf: Add TxBufWrap 7E631698, TxBuf 7E6316C1
InstallProtocolInterface: 41D94CD2-35B6-455A-8258-D4E51334AADD 7E644220
InstallProtocolInterface: 3AD9DF29-4501-478D-B1F8-7F7FE70E50F3 7E632D38
InstallProtocolInterface: F4B427BB-BA21-4F16-BC4E-43E416AB619C 7E633EB0
InstallProtocolInterface: 245DCA21-FB7B-11D3-8F01-00A0C969723B 7E8220E0
Process Load Option (PlatformRecovery0000) ...
SataControllerStart START
SataControllerStart error return status = Already started
SataControllerStart START
SataControllerStart error return status = Already started
 BlockSize : 2048 
 LastBlock : 5C5 
SataControllerStart START
SataControllerStart error return status = Already started
SataControllerStart START
SataControllerStart error return status = Already started
 BlockSize : 2048 
 LastBlock : 5C5 
 BlockSize : 2048 
 LastBlock : 5C5 
FatDiskIo: Cache Page OutBound occurred! 
FSOpen: Open '\EFI\BOOT\BOOTX64.EFI' Success
[Bds] DevicePath expand: \EFI\BOOT\BOOTX64.EFI -> PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0)/CDROM(0x0,0x21,0x143C)/\EFI\BOOT\BOOTX64.EFI
InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B 7E630040
Loading driver at 0x0007DD2D000 EntryPoint=0x0007DD2D240 Shell.efi
InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF 7E644398
InstallProtocolInterface: 387477C2-69C7-11D2-8E39-00A0C969723B 7E624BA0
InstallProtocolInterface: 752F3136-4E16-4FDC-A22A-E5F46812F4CA 7E626F98
InstallProtocolInterface: 6302D008-7F9B-4F30-87AC-60C9FEF5DA4E 7DE5AD40
Load Option (PlatformRecovery0000) Return Status = Success
[Bds] Unable to boot!

 
Expected results: 
  UEFI Boot Setup interface can be returned.

Additional info:
  Attachment is the captured hang screen.

Comment 2 aihua liang 2016-09-06 03:09:02 UTC
Created attachment 1198060 [details]
Screen cut of UEFI Shell hang

Comment 4 Laszlo Ersek 2016-09-06 13:45:29 UTC
Can you please attach the entire OVMF debug log? Thanks.

Comment 5 Laszlo Ersek 2016-09-06 15:49:37 UTC
... I'm asking because I'd like to see the boot order and the rest of the BDS stuff leading up to the failure.

It's always best to upload the full log at once. Thanks.

Comment 6 Laszlo Ersek 2016-09-06 21:49:55 UTC
... Okay, after carefully inspecting the problem, I can assure you that this behavior is by design (i.e., intended), even though it seems obscure at first sight.

There's no need for uploading the full OVMF debug log after all; instead of that, below I'll ask you to repeat your test with a small modification. If that test works, then this is NOTABUG.

So, in your current QEMU command line, you pass two bootable storage devices:

* -device virtio-net-pci,...,bootindex=1
* -cdrom /usr/share/OVMF/UefiShell.iso

I'm not sure what your intent was with this, but here's the effect:

(1) the virtio-net-pci device is added to the "bootorder" fw_cfg file.

(2) The -cdrom option does not add the SATA CD-ROM device to the "bootorder" fw_cfg file.

(3) The result is that OVMF preserves the auto-generated UEFI netboot (PXE boot) option for the virtio-net-pci device, but it drops the auto-generated UEFI boot option for the SATA CD-ROM. This works by design -- if you want to boot a CD-ROM, add bootindex=N.

(4) Netbooting fails.

(5) At this point the BdsEntry() function starts processing platform recovery boot options. The default platform recovery is to execute
\EFI\BOOT\BOOTX64.EFI, wherever it might be. Such a platform recovery binary is expected to restore some usable boot order / boot options, and/or reset the platform.

(6) Since the ISO image that you provided with -cdrom *does* have a binary called \EFI\BOOT\BOOTX64.EFI, it gets executed as platform recovery utility. Alas, that binary is actually the UEFI shell, which does no platform recovery at all.

This is where you type "exit", and expect to return to the UEFI setup TUI. What you didn't realize is that your shell was not launched as a normal UEFI boot option -- see (3) --. Instead, it was launched as a platform recovery app. And when you exit from that without recreating boot options and without resetting the system, then the edk2 BDS driver just gives up, and hangs on purpose. This is again by design.

The solution is simple: replace

  -cdrom /usr/share/OVMF/UefiShell.iso

with

  -drive id=cdrom,media=cdrom,if=none,readonly,format=raw,file=/usr/share/OVMF/UefiShell.iso \
  -device ide-cd,drive=cdrom,bootindex=2

The important part is "bootindex=2". That will cause OVMF to preserve the SATA CD-ROM as second boot option. After the netboot fails, the UEFI shell (under pathname \EFI\BOOT\BOOTX64.EFI) will be launched as a normal boot option (not as platform recovery), and when you exit with success from *that*, then you'll be returned to the edk2 setup TUI.

Can you test this please?

Comment 7 aihua liang 2016-09-07 03:05:33 UTC
Hi, Laszlo

  "Exit" works well when starting UefiShell using cmd:
      -drive id=cdrom,media=cdrom,if=none,readonly,format=raw,file=/usr/share/OVMF/UefiShell.iso \
      -device ide-cd,drive=cdrom,bootindex=2”


Thanks for your explanation.

Close the bug with status "NOTABUG" according to design.


Aliang


Note You need to log in before you can comment on or make changes to this bug.