Re: UEFI + SOL / COM ports = boot hang

From: Matt Simerson <matt_at_tnpi.net>
Date: Wed, 25 Sep 2024 19:59:28 UTC
The default state of this server is that FreeBSD hangs when booting off UEFI and the COM ports are enabled. That seems to be because console includes or adds "efi" by default. Under every circumstance I've tested, when console contains "efi", the server hangs at the same point shown in the first message.

The workaround I've found is setting:

console="comconsole"

FreeBSD assumes that COM 1 is serial, which likely fails to initialize and so with only that setting, the video console remains primary. When that happens, I get no Beastie boot menu on either console. Since the server is now bootable with COM ports, I can tell the kernel where to find the serial port:

# without the next 2 lines, the serial console isn't found and the video console remains primary
comconsole_port="0x2F8"
comconsole_speed="115200"

And now it boots, I get the Beastie menu on the serial console, and later the FreeBSD kernel reports:

Dual Console: Serial Primary, Video Secondary

Changing the settings in BIOS related to console redirection seem not to matter much at all. Pretty much any combination of settings works.

This isn't perfect. The UEFI video console is certainly nicer, and I'd prefer to have it be primary and serial be secondary. But I cannot include 'efi' in loader.conf console setting while the COM ports are enabled else FreeBSD hangs.

The contents of the EFI variable ConOut with console ports disabled:

# efivar -p -d 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut
8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut
: PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)/AcpiAdr(0x80010100)

With console ports enabled and console="comconsole":

# efivar -p -d 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut
8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut
: PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)/AcpiAdr(0x80010100),/PciRoot(0x0)/Pci(0x1f,0x0)/Serial(0x0)/Uart(115200,8,N,1)/UartFlowCtrl(Hardware)/VenUtf8(),/PciRoot(0x0)/Pci(0x1f,0x0)/Serial(0x1)/Uart(115200,8,N,1)/UartFlowCtrl(Hardware)/VenUtf8()

From dmesg:

EFI framebuffer information:
addr, size     0x9c000000, 0x300000
dimensions     1024 x 768
stride         1024
masks          0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000
....
VT(efifb): resolution 1024x768
...
vgapci0: <VGA-compatible display> port 0x2000-0x207f mem 0x9c000000-0x9cffffff,0x9d000000-0x9d01ffff irq 16 at device 0.0 numa-domain 0 on pci2
vgapci0: Boot video device

I was hoping that setting hw.uart.console="io:0x2f8,br:115200" in loader.conf would help, but the server still hangs if 'efi' is included in the console list.

Messing with hint.uart.N as suggested in https://wiki.freebsd.org/SerialConsole didn't help, I'm guessing that's because those settings aren't used by loader.efi.

Any ideas or pointers for other settings which may enable the EFI console to be primary while also having a serial console?

Thanks,
Matt


> On Sep 23, 2024, at 3:22 PM, Matt Simerson <matt@tnpi.net> wrote:
> 
> I have a Quanta D52B-1U server. When I boot it via legacy BIOS, there is no issue. When I boot with UEFI and COM ports & console redirection disabled, there is no issue. However, when boot UEFI and enable the COM ports and/or console redirection, the server hangs at boot time right here:
> 
> Version 2.20.1276. Copyright (C) 2023 American Megatrends, Inc.BIOS Date: 12/04/2023 17:24:26 Ver: 3B28.Q102 
> Consoles: EFI console
>     Reading loader env vars from /efi/freebsd/loader.env
> Setting currdev to disk0p1:
> FreeBSD/amd64 EFI loader, Revision 1.1
> 
>    Command line arguments: loader.efi
>    Image base: 0x5e993000
>    EFI version: 2.70
>    EFI Firmware: American Megatrends (rev 5.14)
>    Console: efi (0x20000000)
>    Load Path: \EFI\FREEBSD\LOADER.EFI
>    Load Device: PciRoot(0x9)/Pci(0x0,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-01-30-54-9D-E4-D2-5C)/HD(1,GPT,F669D424-7170-11EF-83D1-A0369F6BA978,0x28,0x82000)
>    BootCurrent: 0000
>    BootOrder: 0000[*] 0003 0006 0007 0002 0008
>    BootInfo Path: HD(1,GPT,F669D424-7170-11EF-83D1-A0369F6BA978,0x28,0x82000)/\EFI\FREEBSD\LOADER.EFI
> Ignoring Boot0000: Only one DP found
> Trying ESP: PciRoot(0x9)/Pci(0x0,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-01-30-54-9D-E4-D2-5C)/HD(1,GPT,F669D424-7170-11EF-83D1-A0369F6BA978,0x28,0x82000)
> Setting currdev to disk0p1:
> Trying: PciRoot(0x9)/Pci(0x0,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-01-30-54-9D-E4-D2-5C)/HD(2,GPT,4F537B49-7176-11EF-83D1-A0369F6BA978,0x82028,0x1000000)
> Setting currdev to disk0p2:
> Trying: PciRoot(0x9)/Pci(0x0,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-01-30-54-9D-E4-D2-5C)/HD(3,GPT,B6D8B384-7176-11EFLoading /boot/defaults/loader.conf86860)
> Loading /boot/defaults/loader.confdefault:
> Loading /boot/device.hints
> Loading /boot/loader.conf
> Loading /boot/loader.conf.local
> |
> 
> On one occasion, I left it setting there for minutes.
> 
> I currently have FreeBSD 14.1 installed and I also replicated this when booting off a FreeBSD 15.0-CURRENT ISO. 
> 
> The chipset is Intel C621 & C624. Output from dmesg is here.
> 
> BIOS settings which enable console redirection and SOL are:
> 
> Super IO
> Port 0, Disabled or Enabled (IO=3F8h, IRQ=4)
> Port 1, Enabled (IO=2F8h, IRQ=3)   <-- SOL port
> Serial Port Console Redirection
> COM0
> Console Redirection, Port is Disabled
> SOL
> Console Redirection, [Enabled]
> Console Redirection Settings, (VT100, 115200, None)
> Legacy Console Redirection Settings
> Redirection COM Port: SOL (other option: COM0)
> Serial Port for OOB Management/Windows EMS
> Console Redirection: Enabled
> Console Redirection Settings, Out-of-Band Mgmt Port: SOL (other option: COM0)
> Console Redirection Settings, (VT100, 115200, None)
> 
> There are variations on those settings which work for getting BIOS POST messages and the FreeBSD loader messages redirected to the IPMI SOL port.  However, any combination that works also causes FreeBSD to hang at exactly the same spot.
> 
> I'm accustomed to adding a few lines to loader.conf to tell FreeBSD how to direct console output, but nothing added there makes any difference. I've twiddled the hint.uart.* knobs in /boot/device.hints to no avail.
> 
> This is what works on my Dell R630:
> 
> # console port via IPMI & DRAC
> boot_multicons="YES"
> boot_serial="YES"
> console="efi,comconsole"
> # for legacy BIOS
> #console="comconsole,vidconsole"
> comconsole_speed="115200"
> 
> How does one go about troubleshooting this?
> 
> Matt