On Wed, 4 Feb 2026, Jan Beulich wrote:
> On 04.02.2026 00:02, Stefano Stabellini wrote:
> > On Tue, 3 Feb 2026, Jan Beulich wrote:
> >> On 29.01.2026 23:08, Stefano Stabellini wrote:
> >>> @@ -555,7 +566,10 @@ static void console_switch_input(void)
> >>>  
> >>>          if ( next_rx++ >= max_console_rx )
> >>>          {
> >>> +            nrspin_lock_irq(&console_lock);
> >>
> >> As indicated earlier, you can't know IRQ state in anything down the call
> >> tree from serial_rx().
> > 
> > I'll switch to the irqsave/restore versions in console_switch_input
> 
> I've seen that you already sent v9, but seeing how getting the locking right
> has proven to be difficult, I have two more remarks towards this.
> 
> 1) Can the locking additions to existing code please be split out into a
>    separate patch?

I did this


> 2) As all of this is for dom0less only (for now at least), did you consider
>    to make all of these changes dependent upon a new Kconfig option, so to
>    avoid impacting other environments in case issues remain when this has
>    gone in?

Effectively it is already the case because:

#define max_console_rx (max_init_domid + 1)

I could easily add an #ifdef around is_focus_domain() so that in case
CONFIG_DOM0LESS_BOOT is disabled it defaults to is_hardware_domain() but
that wouldn't really help because thanks to the definition of
max_console_rx, effectively it works the same way when
CONFIG_DOM0LESS_BOOT is disabled.

I think what you are asking would be more about the locking changes in
guest_console_write, but for those I cannot really use #ifdef to retain
the current position of the locks. The resulting code would not be good.

So I decided to not make any changes in this regard. However, I am happy
to #ifdef is_focus_domain() although as I said I don't think it would
bring much value.

Reply via email to