From: dmukhin@xen.org
To: Stefano Stabellini <stefano.stabellini@amd.com>
Cc: xen-devel@lists.xenproject.org, grygorii_strashko@epam.com,
anthony.perard@vates.tech, michal.orzel@amd.com, julien@xen.org,
roger.pau@citrix.com, jason.andryuk@amd.com,
victorm.lira@amd.com, andrew.cooper3@citrix.com,
jbeulich@suse.com, sstabellini@kernel.org
Subject: Re: [PATCH v10 5/5] xen: enable dom0less guests to use console_io hypercalls
Date: Wed, 4 Feb 2026 18:09:44 -0800 [thread overview]
Message-ID: <aYP76EsG3bf3Yp4I@kraken> (raw)
In-Reply-To: <20260204233712.3396752-5-stefano.stabellini@amd.com>
On Wed, Feb 04, 2026 at 03:37:12PM -0800, Stefano Stabellini wrote:
> Enable dom0less guests on ARM to use console_io hypercalls:
> - set input_allow = true for dom0less domains
> - update the in-code comment in console.c
> - prioritize the VUART check to retain the same behavior as today
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
The code looks good, just one remark wrt prioritizing VUART check.
> ---
> xen/common/device-tree/dom0less-build.c | 2 ++
> xen/drivers/char/console.c | 16 ++++++++++------
> 2 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
> index 840d14419d..cb7026fa7e 100644
> --- a/xen/common/device-tree/dom0less-build.c
> +++ b/xen/common/device-tree/dom0less-build.c
> @@ -829,6 +829,8 @@ static int __init construct_domU(struct kernel_info *kinfo,
>
> rangeset_destroy(kinfo->xen_reg_assigned);
>
> + d->console->input_allowed = true;
> +
> return rc;
> }
>
> diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
> index d3ce925131..7f0c3d8376 100644
> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -610,11 +610,20 @@ static void __serial_rx(char c)
> if ( ACCESS_ONCE(console_rx) == 0 )
> return handle_keypress(c, false);
>
> + /* Includes an is_focus_domain() check. */
> d = console_get_domain();
> if ( !d )
> return;
>
> - if ( is_hardware_domain(d) )
Hardware domain on x86 may have an emulated UART (not in upstream, through,
I need to send v8 for NS16550 series...). The patch which illustrates the
idea:
https://lore.kernel.org/xen-devel/20250908211149.279143-2-dmukhin@ford.com/
So this code (hopefully soon) will need adjustment again.
I would update the code to something like:
if ( is_hardware_domain(d) && !domain_has_vuart(d) )
{
// handle hardware domain
}
#ifdef CONFIG_SBSA_VUART_CONSOLE
else if ( domain_has_vuart(d) )
/* Deliver input to the emulated UART. */
rc = vpl011_rx_char_xen(d, c);
#endif
But domain_has_vuart() needs to be defined for all architectures
(currently it is hidden in arch/arm/vuart.c).
Or perhaps it is possible to postpone the change?
What do you think?
> +#ifdef CONFIG_SBSA_VUART_CONSOLE
> + /* Prioritize vpl011 if enabled for this domain */
> + if ( d->arch.vpl011.base_addr )
> + {
> + /* Deliver input to the emulated UART. */
> + rc = vpl011_rx_char_xen(d, c);
> + }
> + else
> +#endif
> {
> unsigned long flags;
>
> @@ -633,11 +642,6 @@ static void __serial_rx(char c)
> */
> send_guest_domain_virq(d, VIRQ_CONSOLE);
> }
> -#ifdef CONFIG_SBSA_VUART_CONSOLE
> - else
> - /* Deliver input to the emulated UART. */
> - rc = vpl011_rx_char_xen(d, c);
> -#endif
>
> if ( consoled_is_enabled() )
> /* Deliver input to the PV shim console. */
> --
> 2.25.1
>
>
next prev parent reply other threads:[~2026-02-05 2:10 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 23:35 [PATCH v10 0/5] xen: console_io for dom0less guests Stefano Stabellini
2026-02-04 23:37 ` [PATCH v10 1/5] xen/console: use ACCESS_ONCE for console_rx Stefano Stabellini
2026-02-05 2:13 ` dmukhin
2026-02-04 23:37 ` [PATCH v10 2/5] xen: change VIRQ_CONSOLE to VIRQ_DOMAIN to allow non-hwdom binding Stefano Stabellini
2026-02-06 0:50 ` dmukhin
2026-02-09 9:13 ` Jan Beulich
2026-02-09 23:23 ` Stefano Stabellini
2026-02-10 7:47 ` Jan Beulich
2026-02-13 20:09 ` Stefano Stabellini
2026-02-16 9:04 ` Jan Beulich
2026-02-18 15:07 ` Daniel P. Smith
2026-02-18 15:14 ` Jan Beulich
2026-02-18 16:08 ` Daniel P. Smith
2026-02-04 23:37 ` [PATCH v10 3/5] xen/console: add locking for serial_rx ring buffer access Stefano Stabellini
2026-02-06 22:24 ` dmukhin
2026-02-10 15:48 ` Jan Beulich
2026-02-04 23:37 ` [PATCH v10 4/5] xen/console: handle multiple domains using console_io hypercalls Stefano Stabellini
2026-02-06 22:29 ` dmukhin
2026-02-10 16:05 ` Jan Beulich
2026-02-04 23:37 ` [PATCH v10 5/5] xen: enable dom0less guests to use " Stefano Stabellini
2026-02-05 2:09 ` dmukhin [this message]
2026-02-05 22:09 ` Stefano Stabellini
2026-02-06 0:47 ` dmukhin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aYP76EsG3bf3Yp4I@kraken \
--to=dmukhin@xen.org \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=grygorii_strashko@epam.com \
--cc=jason.andryuk@amd.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=stefano.stabellini@amd.com \
--cc=victorm.lira@amd.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.