On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > --- a/xen/drivers/char/console.c > +++ b/xen/drivers/char/console.c > @@ -463,82 +463,100 @@ static void cf_check dump_console_ring_key(unsigned > char key) > > /* > * CTRL-<switch_char> changes input direction, rotating among Xen, Dom0, > - * and the DomUs started from Xen at boot. > + * and the DomUs. > */ > #define switch_code (opt_conswitch[0]-'a'+1) > + > /* > - * console_owner=0 => input to xen > - * console_owner=1 => input to dom0 (or the sole shim domain) > - * console_owner=N => input to dom(N-1) > + * Current console owner domain ID: either Xen or domain w/ d->is_console == > + * true.
The switching of number space may better have been a separate patch. Albeit maybe I'm just not seeing why it wants combining with the introduction of console_set_owner(). Actually, is this switching actually complete? What about late hwdom, which has a non-zero domain ID? > + * Initialized in console_endboot(). > */ > -static unsigned int __read_mostly console_owner = 0; > +static domid_t __read_mostly console_owner; > > -#define max_console_rx (max_init_domid + 1) > +static struct domain *rcu_lock_domain_console_by_id(domid_t domid) I think "domain" and "console" want switching in the name, as it's a domain you're locking, not a console. > +int console_set_owner(domid_t domid) static? Iirc Misra doesn't like non-static functions which aren't called from any other CU. Jan