Skip to contentSkip to conversation

Console vs serial

DISCUSSION Andrew Cooper 3 participants 3 messages Aug 1, 2025

lore
Share & tools
lore
#0 lore raw

Hello,

There's a long-standing irritation in Xen, whereby printk()'s which occur prior to console_init_preirq() get half-lost.

They end up in the console ring, and hence are available via xl dmesg, but they're missing from serial console.

e.g. these 4 lines don't escape

    (XEN) Enabling lockdown mode because Secure Boot is enabled (XEN) Lockdown mode is enabled
    (XEN) Ignoring cmdline option 'hap_2mb' in lockdown mode (XEN) Ignoring cmdline option 'hap_1gb' in lockdown mode __  __            _  _    _  ___   ____
     \ \/ /___ _ __   | || |  / |/ _ \ |___ \

This is from a testcase failure I've just debugged, but the issue is not specific to secureboot.  More generally, any diagnostic from cmdline parsing ends up in this state.

For PVShim, we did a gross hack to assume the PV console is usable right from the outset, but all other console configurations don't start working until the cmdline has been parsed.

Is anything stopping us from feeding the current contents of the console ring into serial in console_init_preirq()?

~Andrew

#1 lore raw
Quoted 23 lines · Andrew Cooper

Hello,

There's a long-standing irritation in Xen, whereby printk()'s which occur prior to console_init_preirq() get half-lost.

They end up in the console ring, and hence are available via xl dmesg, but they're missing from serial console.

e.g. these 4 lines don't escape

(XEN) Enabling lockdown mode because Secure Boot is enabled (XEN) Lockdown mode is enabled
(XEN) Ignoring cmdline option 'hap_2mb' in lockdown mode (XEN) Ignoring cmdline option 'hap_1gb' in lockdown mode
__ __ _ _ _ ___ ____
\ \/ /___ _ __ | || | / |/ _ \ |___ \

This is from a testcase failure I've just debugged, but the issue is not specific to secureboot. More generally, any diagnostic from cmdline parsing ends up in this state.

Quoted 9 lines

For PVShim, we did a gross hack to assume the PV console is usable right from the outset, but all other console configurations don't start working until the cmdline has been parsed.

Is anything stopping us from feeding the current contents of the console ring into serial in console_init_preirq()?

~Andrew

I don't think there's a problem replaying the console logs into the serial once the serial is set up.
It will slow down the boot maybe but beside that it should be fine.

Frediano

#2 lore raw
Quoted 31 lines · Frediano Ziglio
Quoted 30 lines · Andrew Cooper

Hello,

There's a long-standing irritation in Xen, whereby printk()'s which occur prior to console_init_preirq() get half-lost.

They end up in the console ring, and hence are available via xl dmesg, but they're missing from serial console.

e.g. these 4 lines don't escape

(XEN) Enabling lockdown mode because Secure Boot is enabled (XEN) Lockdown mode is enabled
(XEN) Ignoring cmdline option 'hap_2mb' in lockdown mode (XEN) Ignoring cmdline option 'hap_1gb' in lockdown mode
__ __ _ _ _ ___ ____
\ \/ /___ _ __ | || | / |/ _ \ |___ \

This is from a testcase failure I've just debugged, but the issue is not specific to secureboot. More generally, any diagnostic from cmdline parsing ends up in this state.

For PVShim, we did a gross hack to assume the PV console is usable right from the outset, but all other console configurations don't start working until the cmdline has been parsed.

Is anything stopping us from feeding the current contents of the console ring into serial in console_init_preirq()?

Quoted 6 lines
Quoted 2 lines

~Andrew

I don't think there's a problem replaying the console logs into the serial once the serial is set up.
It will slow down the boot maybe but beside that it should be fine.

Replaying console logs into the serial is already a case on staging branch:
console_init_preirq() calls conring_flush(..), which will replay everything from conring into all available console devices.

--
Denis

Quoted 3 lines

Frediano