All of lore.kernel.org
 help / color / mirror / Atom feed
From: dmkhn@proton.me
To: Jan Beulich <jbeulich@suse.com>
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech,
	julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
	sstabellini@kernel.org, dmukhin@ford.com,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 2/8] emul/vuart: introduce framework for UART emulators
Date: Mon, 11 Aug 2025 23:55:56 +0000	[thread overview]
Message-ID: <aJqDCJp19/iMIfDq@kraken> (raw)
In-Reply-To: <6953603b-8c3f-4f12-9f5e-45cb553fe8cc@suse.com>

On Mon, Aug 11, 2025 at 09:34:58AM +0200, Jan Beulich wrote:
> On 09.08.2025 20:55, dmkhn@proton.me wrote:
> > On Mon, Aug 04, 2025 at 12:11:03PM +0200, Jan Beulich wrote:
> >> On 31.07.2025 21:21, dmkhn@proton.me wrote:
> >>> --- a/xen/common/Kconfig
> >>> +++ b/xen/common/Kconfig
> >>> @@ -1,6 +1,8 @@
> >>>
> >>>  menu "Common Features"
> >>>
> >>> +source "common/emul/Kconfig"
> >>> +
> >>>  config COMPAT
> >>
> >> Why at the very top?
> >
> > I did not find a better place, since the settings are not sorted and to me it
> > makes sense to list emulation capabilities first...
> >
> > Where would be the best location for that submenu?
> > Close to another submenu `source "common/sched/Kconfig"`?
> 
> At least below there. Possibly yet further down.
> 
> >>> +int vuart_init(struct domain *d, struct vuart_params *params)
> >>> +{
> >>> +    const struct vuart_ops *vdev;
> >>> +    int rc;
> >>> +
> >>> +    if ( !domain_has_vuart(d) )
> >>> +        return 0;
> >>> +
> >>> +    for_each_vuart(vdev)
> >>> +    {
> >>> +        rc = vdev->init(d, params);
> >>> +        if ( rc )
> >>> +            return rc;
> >>> +    }
> >>> +
> >>> +    d->console.input_allowed = true;
> >>
> >> Unconditionally?
> >
> > Thanks.
> > That should be a least under rc == 0.
> 
> You only ever make it there with rc == 0, though. (In fact that variable's
> scope would better be just the loop body.)
> 
> >>> +/*
> >>> + * Put character to the first suitable emulated UART's FIFO.
> >>> + */
> >>
> >> What's "suitable"? Along the lines of the earlier remark, what if the domain
> >> has vUART kind A configured, ...
> >
> > "suitable" is meant to be the first emulator with put_rx != NULL.
> > I will update that.
> 
> Except that, as iirc Roger also pointed out, "first emulator with put_rx != NULL"
> is a questionable condition.
> 
> >>> --- a/xen/common/keyhandler.c
> >>> +++ b/xen/common/keyhandler.c
> >>> @@ -22,6 +22,7 @@
> >>>  #include <xen/mm.h>
> >>>  #include <xen/watchdog.h>
> >>>  #include <xen/init.h>
> >>> +#include <xen/vuart.h>
> >>>  #include <asm/div64.h>
> >>>
> >>>  static unsigned char keypress_key;
> >>> @@ -354,6 +355,8 @@ static void cf_check dump_domains(unsigned char key)
> >>>                             v->periodic_period / 1000000);
> >>>              }
> >>>          }
> >>> +
> >>> +        vuart_dump_state(d);
> >>
> >> How verbose is this going to get?
> >
> > Looks something like this:
> > ```
> > (XEN) [   88.334893] 'q' pressed -> dumping domain info (now = 88334828303)
> > [..]
> > (XEN) [   88.335673] Virtual ns16550 (COM2) I/O port 0x02f8 IRQ#3 owner d0
> > (XEN) [   88.335681]   RX FIFO size 1024 in_prod 258 in_cons 258 used 0
> > (XEN) [   88.335689]   TX FIFO size 2048 out_prod 15 out_cons 0 used 15
> > (XEN) [   88.335696]   00 RBR 02 THR 6f DLL 01 DLM 00
> > (XEN) [   88.335703]   01 IER 05
> > (XEN) [   88.335709]   02 FCR 81 IIR c1
> > (XEN) [   88.335715]   03 LCR 13
> > (XEN) [   88.335720]   04 MCR 0b
> > (XEN) [   88.335726]   05 LSR 60
> > (XEN) [   88.335731]   06 MSR b0
> > (XEN) [   88.335736]   07 SCR 00
> >
> > ```
> 
> Definitely too much (for my taste) to put under 'q'.

I'll try to limit the number of printed lines; register dump can be made
compact for sure.

> 
> Jan



  reply	other threads:[~2025-08-11 23:56 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31 19:21 [PATCH v4 0/8] x86: introduce NS16550-compatible UART emulator dmkhn
2025-07-31 19:21 ` [PATCH v4 1/8] xen/domain: introduce common emulation flags dmkhn
2025-08-04  9:46   ` Jan Beulich
2025-08-05  0:54     ` dmkhn
2025-08-06 13:56       ` Roger Pau Monné
2025-08-07 17:54         ` dmkhn
2025-08-07 14:28       ` Oleksii Kurochko
2025-08-07 17:43         ` dmkhn
2025-07-31 19:21 ` [PATCH v4 2/8] emul/vuart: introduce framework for UART emulators dmkhn
2025-08-01  0:08   ` Stefano Stabellini
2025-08-01  2:54     ` dmkhn
2025-08-04 10:11   ` Jan Beulich
2025-08-09 18:55     ` dmkhn
2025-08-11  7:34       ` Jan Beulich
2025-08-11 23:55         ` dmkhn [this message]
2025-08-12  6:52           ` Jan Beulich
2025-08-14  6:32             ` dmkhn
2025-08-06 14:24   ` Roger Pau Monné
2025-08-07 19:12     ` dmkhn
2025-07-31 19:21 ` [PATCH v4 3/8] x86/domain: allocate d->{iomem,irq}_caps before arch-specific initialization dmkhn
2025-07-31 19:52   ` Grygorii Strashko
2025-07-31 20:21     ` dmkhn
2025-08-01  2:57       ` dmkhn
2025-07-31 23:20   ` Stefano Stabellini
2025-08-04 10:20   ` Jan Beulich
2025-08-07 18:59     ` dmkhn
2025-08-06 14:37   ` Roger Pau Monné
2025-08-07 18:57     ` dmkhn
2025-07-31 19:22 ` [PATCH v4 4/8] xen/8250-uart: update definitions dmkhn
2025-07-31 23:23   ` Stefano Stabellini
2025-08-04 10:23   ` Jan Beulich
2025-08-07 19:41     ` dmkhn
2025-07-31 19:22 ` [PATCH v4 5/8] emul/vuart-ns16550: introduce NS16550-compatible UART emulator (x86) dmkhn
2025-07-31 23:57   ` Stefano Stabellini
2025-08-01  3:28     ` dmkhn
2025-08-04 10:53   ` Jan Beulich
2025-08-09 18:37     ` dmkhn
2025-08-11  7:39       ` Jan Beulich
2025-08-12  0:06         ` dmkhn
2025-08-06 15:06   ` Roger Pau Monné
2025-08-06 17:24     ` Roger Pau Monné
2025-08-07 18:49     ` dmkhn
2025-07-31 19:22 ` [PATCH v4 6/8] tools/xl: enable NS16550-compatible UART emulator for HVM (x86) dmkhn
2025-08-04 10:54   ` Jan Beulich
2025-08-06 15:21   ` Roger Pau Monné
2025-08-25 14:49   ` Anthony PERARD
2025-08-25 15:03     ` Jan Beulich
2025-08-25 15:13       ` Anthony PERARD
2025-08-25 15:27         ` Jan Beulich
2025-08-25 15:39           ` Anthony PERARD
2025-08-25 15:45             ` Jan Beulich
2025-08-26  9:26     ` dmkhn
2025-07-31 19:22 ` [PATCH v4 7/8] tools/xl: enable NS16550-compatible UART emulator for PVH (x86) dmkhn
2025-08-01  0:46   ` Stefano Stabellini
2025-08-01  1:53     ` dmkhn
2025-08-04 11:06   ` Jan Beulich
2025-08-07 19:38     ` dmkhn
2025-07-31 19:22 ` [PATCH v4 8/8] emul/vuart: introduce console forwarding enforcement via vUART dmkhn
2025-08-01  0:10   ` Stefano Stabellini
2025-08-01  1:51     ` dmkhn
2025-08-06 13:48 ` [PATCH v4 0/8] x86: introduce NS16550-compatible UART emulator Roger Pau Monné

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=aJqDCJp19/iMIfDq@kraken \
    --to=dmkhn@proton.me \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=dmukhin@ford.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --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.