[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/console: Handle true dom0less case when switching serial input


  • To: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 14 Mar 2023 16:17:53 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dP0CLX1VKiNTtvd2FwtZNWTNqLghbjIrJm1d0BFUvCQ=; b=BQ4wfvaO+0zX++MJOuSeIaQZm3WL1HorwTG34tycyMRcGTOuaW6+fwJ3gaJmkd/YGb/i9Kz49ut6vEgrGRKMStgDLRA8nWaGeOKvcPuxCaFh8MSRi+MPr/zr947WTLCINSzM941BB207s9uvumGLi/T4MApoJGEcOGr3L15+qC5RQ1oXGZXEtJhNzbgPxqKt5bIA6j0LDn4o5w05gOtj0G3zTOL88Q5QQMYiI7h4Zz2J7v1/KBohs5eIG6bo8Yc3t6iV4a7H2LMhhlHHVRBgmSgueqhu9B/6rSDsX+nZC/tsxfLTtJpXUXfArYMtjaeQmH3MTgMJ2VSIbV76vlD8WQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V0ZOx5Fk4Z3zIRYRqMREa5jIQeGCrs+utzcwLrTeYaGIhEOfiQAyFhewqJDogSnx37/GTay2y9UjWHJS+M0Af0BrxGKE6eWa+Om+dNKFd706KcA/aydLXsXkCHib4ArNii4tOznaMjaNlw28hGiH6OpaIuARTVmjegZCk2G2u0VYuo9mk3ZpGadQxL75weyuwgCk2bDubnBabl4DvrVk1Wt79tWgQEssl4PDzlFTzU7e2dhbzRsp+NoCeBYh8mSk7lv0OHOLdEkm+21yKBOkLQfCrIp4cB888i5hSa9T2jIuLt+0McP9l/llvpGJCtc1ldfyVNeVZcSnjGZrpwtwtw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 14 Mar 2023 15:18:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.03.2023 15:27, Michal Orzel wrote:
> At the moment, we direct serial input to hardware domain by default.
> This does not make any sense when running in true dom0less mode, since
> such domain does not exist. As a result, users wishing to write to
> an emulated UART of a domU are always forced to execute CTRL-AAA first.
> The same issue is when rotating among serial inputs, where we always
> have to go through hardware domain case.
> 
> Modify switch_serial_input() so that, if there is no hardware domain
> (i.e. true dom0less case) and console_rx is 1 (i.e. input to hwdom),
> we skip it and move to the next serial input.
> 
> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>

Makes sense, but I think there are more things to consider.

> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -491,6 +491,14 @@ static void switch_serial_input(void)
>      else
>      {
>          console_rx++;
> +
> +        /*
> +         * Skip switching serial input to hardware domain if it does not 
> exist
> +         * (i.e. true dom0less mode).
> +         */
> +        if ( !hardware_domain && (console_rx == 1) )
> +            console_rx++;

The consumers of this variable aren't really serialized with this
updating. That's probably okay-ish prior to your change, but now
there can be two updates in rapid succession. I think it would be
better if the variable was written only once here.

>          printk("*** Serial input to DOM%d", console_rx - 1);

When invoked from console_endboot() this will now switch to Dom1,
i.e. that domain becomes kind of "preferred", which I think is
wrong. Instead I think in such a case we should direct input to
Xen by default.

And then I have a question about Dom<N> lifetime in dom0less: Can
such domains be short-lived? If yes, what you do here for Dom0
would likely want generalizing, to skip any domain that doesn't
exist (anymore).

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.