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 v3 2/2] xen/console: unify printout behavior for UART emulators
Date: Wed, 11 Jun 2025 00:07:00 +0000	[thread overview]
Message-ID: <aEjInVF3zaa+VVd2@kraken> (raw)
In-Reply-To: <bcb3d553-b8aa-42ab-a9c8-7abf6f5d02c3@suse.com>

On Tue, Jun 10, 2025 at 10:21:40AM +0200, Jan Beulich wrote:
> On 06.06.2025 22:11, dmkhn@proton.me wrote:
> > From: Denis Mukhin <dmukhin@ford.com>
> >
> > If virtual UART from domain X prints on the physical console, the behavior is
> > updated to (see [1]):
> > - console focus in domain X: do not prefix messages;
> > - no console focus in domain X: prefix all messages with "(dX)".
> 
> While, as indicated (much) earlier, I can see why omitting the prefix
> may make sense for the domain having input focus, ...
> 
> > --- a/xen/drivers/char/console.c
> > +++ b/xen/drivers/char/console.c
> > @@ -740,7 +740,17 @@ static long guest_console_write(XEN_GUEST_HANDLE_PARAM(char) buffer,
> >          if ( is_hardware_domain(cd) )
> >          {
> >              /* Use direct console output as it could be interactive */
> > +            char prefix[16] = "";
> > +            struct domain *consd;
> > +
> > +            consd = console_get_domain();
> > +            if ( consd != cd )
> > +                snprintf(prefix, sizeof(prefix), "(d%d) ", cd->domain_id);
> > +            console_put_domain(consd);
> > +
> >              nrspin_lock_irq(&console_lock);
> > +            if ( prefix[0] != '\0' )
> > +                console_send(prefix, strlen(prefix), flags);
> >              console_send(kbuf, kcount, flags);
> >              nrspin_unlock_irq(&console_lock);
> >          }
> 
> ... this, aiui, is a behavioral change for the non-dom0less case, where
> Dom0 output will suddenly also gain the prefix. Which I don't think is
> wanted: Switching focus between Xen and Dom0 should remain unaffected
> in this regard.

This change ensures that dom0 traces aren't mixed with domU traces when domU
has input focus, or with Xen traces when the administrator is in the diagnostic
console.

Also, this can be used in the non-interactive tests (e.g. XTF).

> 
> Jan
> 



  reply	other threads:[~2025-06-11  0:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-06 20:11 [PATCH v3 0/2] xen/console: updates to diagnostic messages prefixes dmkhn
2025-06-06 20:11 ` [PATCH v3 1/2] xen/console: introduce CONSOLE_PREFIX dmkhn
2025-07-25  1:02   ` Stefano Stabellini
2025-06-06 20:11 ` [PATCH v3 2/2] xen/console: unify printout behavior for UART emulators dmkhn
2025-06-10  8:21   ` Jan Beulich
2025-06-11  0:07     ` dmkhn [this message]
2025-06-11  5:39       ` Jan Beulich
2025-06-11 19:07         ` Stefano Stabellini
2025-06-12  6:51           ` Jan Beulich
2025-06-18  0:39             ` Stefano Stabellini
2025-06-18  6:27               ` Jan Beulich
2025-06-19  0:45                 ` Stefano Stabellini
2025-06-20  6:07                   ` Jan Beulich
2025-06-21  0:52                     ` Stefano Stabellini
2025-06-28 17:26                       ` Julien Grall
2025-06-28 17:28                         ` Julien Grall
2025-07-08 23:30                         ` dmkhn
2025-06-27 16:54                   ` Julien Grall
2025-06-27 21:58                     ` Stefano Stabellini
2025-06-29 13:47                       ` Jan Beulich
2025-06-30 22:22                         ` Stefano Stabellini
2025-06-30 22:27                           ` Stefano Stabellini
2025-07-08 23:33                             ` dmkhn
2025-07-08 23:32                         ` dmkhn
2025-06-25 10:50   ` Roger Pau Monné
2025-07-08 23:27     ` dmkhn

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=aEjInVF3zaa+VVd2@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.